static String toXmlString ( Node node ) { try { Transformer transformer = getTF ( ) . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . OMIT_XML_DECLARATION , "yes" ) ; transformer . setOutputProperty ( OutputKeys . ENCODING , "UTF-8" ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "no" ) ; StringWriter sw = new StringWriter ( ) ; StreamResult result = new StreamResult ( sw ) ; DOMSource source = new DOMSource ( node ) ; transformer . transform ( source , result ) ; return sw . toString ( ) ; } catch ( Exception e ) { throw wrap ( e ) ; } }
Get xml string for contents of node .