try {
Configuration config = ((TransformerFactoryImpl)tFactory).getConfiguration();
DocumentWrapper docw = new DocumentWrapper(input,null,config);
JDOMResult out = new JDOMResult();
Templates templates = tFactory.newTemplates(new StreamSource(xslt));
Transformer transformer = templates.newTransformer();
transformer.transform(docw, out);
doc = out.getDocument();
}
catch(Exception e) {
throw new FitsToolException(info.getName()+": Error converting output using "+xslt,e);