println("Converted to DOM4J tree using DOM: " + document);
// now lets write it back as SAX events to
// a SAX ContentHandler which should build up a new document
SAXContentHandler contentHandler = new SAXContentHandler();
SAXWriter saxWriter = new SAXWriter(contentHandler, null,
contentHandler);
saxWriter.write(document);
document = contentHandler.getDocument();
println("Converted DOM4J to SAX events then back to DOM4J: " + document);
return document;