public void printSource ( Source src , PrintStream out ) { TransformerFactory tFact = TransformerFactory . newInstance ( ) ; try { Transformer transformer = tFact . newTransformer ( ) ; Result result = new StreamResult ( out ) ; transformer . transform ( src , result ) ; } catch ( TransformerConfigurationException ex ) { ex . printStackTrace ( ) ; } catch ( TransformerException ex ) { ex . printStackTrace ( ) ; } }
A utility method to print this source tree to the given stream .