protected Document roundTripSAX(Document document) throws Exception {
// 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, contentHandler,
contentHandler);
saxWriter.write(document);
Document newDocument = contentHandler.getDocument();
// lets ensure names are same
newDocument.setName(document.getName());