Source xml = new StreamSource(inputXml);
Source xsl = new StreamSource(xslResource.toExternalForm());
final StreamResult streamResult;
final Templates templates = TransformerFactory.newInstance().newTemplates(xsl);
streamResult = new StreamResult(pipedOut);
templates.newTransformer().transform(xml, streamResult);
} catch (TransformerConfigurationException e) {
throw new RuntimeException("Error initializing XSL transformer", e);
} catch (TransformerException e) {
throw new RuntimeException("Error transforming", e);
} finally {