StringWriter outString = new StringWriter();
/* TODO: This should be reviewed at some point to see if we can use the
* DOM3 LS capability and hence a standard way of doing this rather
* than using an internal implementation class.
*/
OutputFormat format = new OutputFormat();
format.setOmitXMLDeclaration(true);
format.setIndenting(true);
XMLSerializer serializer = new XMLSerializer(outString, format);
serializer.serialize(doc);
if (log.isDebugEnabled())
log.debug(outString.toString());
} catch (Exception e) {