private String newXML(IdentifiedObject resource)
      throws DatatypeConfigurationException, FeedException {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    EntryType entry = new EntryType();
    entry.getLinks().add(new LinkType(LinkType.SELF, "self"));
    entry.setTitle("entry");
    entry.setId("id");
    entry.setPublished(new DateTimeType());
    entry.setUpdated(new DateTimeType());
    ContentType content = new ContentType();
    content.setResources(Lists.<IdentifiedObject>newArrayList(resource));
    entry.setContent(content);

    fragmentMarshaller.marshal(entry, new StreamResult(os));

    return os.toString();
  }