code: public static void simpleTransform(final String contextFile, final InputStream xsltSource, final File result,
          final Map<String, String> parameters) throws TransformerException {
          final TransformerFactory tFactory = TransformerFactory.newInstance("net.sf.saxon.TransformerFactoryImpl", null);
          final Transformer transformer = tFactory.newTransformer(new StreamSource(xsltSource));
          applyParameters(transformer, parameters);
          transformer.transform(new StreamSource(new File(contextFile)), new StreamResult(result));
      }
docs: Simple transformation method.
  
  @param contextFile
  - Absolute path to source xml file.
  @param StreamSource
  - the xslt file.
  @param resultDir
  - Directory where you want to put resulting files.
  @param parameters
  - Map defining global XSLT parameters based via transformer to the XSLT file.
  @throws TransformerException