public static String node2String ( final Node node , boolean prettyPrint , String encoding ) throws UnsupportedEncodingException { final ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; new DOMWriter ( new PrintWriter ( baos ) , encoding ) . setPrettyprint ( prettyPrint ) . print ( node ) ; return baos . toString ( encoding ) ; }
Converts XML node in specified pretty mode and encoding to string .