public static String toXML ( final Node aNode ) throws TransformerException { try { final TransformerFactory transFactory = TransformerFactory . newInstance ( ) ; final Transformer transformer = transFactory . newTransformer ( ) ; final StringWriter buffer = new StringWriter ( ) ; final DOMSource domSource = new DOMSource ( aNode ) ; final StreamResult streamResult = new StreamResult ( buffer ) ; final String omitDeclaration = OutputKeys . OMIT_XML_DECLARATION ; transformer . setOutputProperty ( omitDeclaration , "yes" ) ; transformer . transform ( domSource , streamResult ) ; return buffer . toString ( ) ; } catch ( final TransformerConfigurationException details ) { throw new I18nRuntimeException ( details ) ; } }
Returns an XML string representation of the supplied node .