transformerHandler.setResult(new StreamResult(writer));
if ( node.getNodeType() != Node.DOCUMENT_NODE ) {
transformerHandler.startDocument();
}
DOMStreamer domStreamer = new DOMStreamer(transformerHandler, transformerHandler);
domStreamer.stream(node);
if ( node.getNodeType() != Node.DOCUMENT_NODE ) {
transformerHandler.endDocument();
}
return writer.toString();
} catch (javax.xml.transform.TransformerException local) {