}
else {
serializer = new DefaultXMLSerialization();
}
GedcomxConversionResult result = mapper.toGedcomx(gedcom);
GedcomxOutputStream output = new GedcomxOutputStream(outputStream, serializer);
output.addAttribute("User-Agent", "Gedcom To Gedcomx Java Conversion Utility/1.0");
output.addAttribute("X-DC-conformsTo", "http://gedcomx.org/file/v1");
output.addAttribute("X-DC-created", GedcomxTimeStampUtil.formatAsXmlUTC(new Date()));
if (result.getDatasetContributor() != null && result.getDatasetContributor().getId() != null) {
output.addAttribute("X-DC-creator", "tree.xml#" + result.getDatasetContributor().getId());
}
output.addResource("tree.xml", result.getDataset(), null);
output.close();
}
}