private Transformer buildTransformer(String name, File xslDir, TransformerFactory tf) throws Exception { Transformer tr = tf.newTransformer( new StreamSource( new FileReader(xslDir.getAbsolutePath() + File.separatorChar + name + ".xsl"))); tr.setOutputProperty(OutputKeys.INDENT, "yes"); tr.setOutputProperty(OutputKeys.METHOD, "html"); tr.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "3"); return tr; }