try {
Source sourceInput = new StreamSource(new FileInputStream(inFilename));
Source styleSource = new StreamSource(new FileInputStream(xslFilename));
CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
Controller controller = (Controller) sheet.newTransformer();
StringWriter outWriter = new StringWriter();
javax.xml.transform.Result result = new StreamResult(outWriter);
try {
controller.transform(sourceInput, result);
System.out.println(outWriter.getBuffer().toString());