XmlObject xmlObject = parse(source);
xmlObject = upgrade(xmlObject);
XmlOptions xmlOptions = new XmlOptions();
xmlOptions.setSavePrettyPrint();
xmlObject.save(target, xmlOptions);
}
public XmlObject upgrade(XmlObject xmlObject) throws XmlException {
XmlCursor cursor = xmlObject.newCursor();