question: public static String print ( Node node , String encoding ) { if ( node == null ) { return null ; } try { TransformerFactory tFactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tFactory . newTransformer ( ) ; transformer . setOutputProperty ( "omit-xml-declaration" , "yes" ) ; transformer . setOutputProperty ( "encoding" , encoding ) ; DOMSource source = new DOMSource ( node ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( 2000 ) ; StreamResult result = new StreamResult ( os ) ; transformer . transform ( source , result ) ; return os . toString ( encoding ) ; } catch ( Exception e ) { return null ; } }
target:  Prints a Node tree recursively.