TransformerFactory tFactory = TransformerFactory.newInstance();
Source stylesheet = tFactory.getAssociatedStylesheet(stream, null, null, null);
if ( stylesheet == null ) throw (new Exception("SOSXMLTransformer: no stylesheet found in input file." ));
Transformer transformer = tFactory.newTransformer(stylesheet);
addParameters(transformer, parameters);
transformer.transform(stream,
new StreamResult(new FileOutputStream(outputFile)));
}