}
// then copy all the children
document.getRootElement().addNodes(content.getChildren());
// then save the document
xml = document.toXML();
}
if (file.exists()) {
file.setContents(new ByteArrayInputStream(xml.getBytes()), true, true, new NullProgressMonitor());
} else {
file.create(new ByteArrayInputStream(xml.getBytes()), true, new NullProgressMonitor());