private static Transformer newTransformer(String systemId, String xslString, URIResolver uriResolver, Map params) throws Exception {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
if (uriResolver != null)
transformerFactory.setURIResolver(uriResolver);
StreamSource xslStreamSource = null;
if(systemId != null)
xslStreamSource = new StreamSource(new StringReader(xslString), systemId);
else
xslStreamSource = new StreamSource(new StringReader(xslString));
Transformer transformer = transformerFactory.newTransformer(xslStreamSource);
if(params != null) {
Iterator iter = params.entrySet().iterator();
while(iter.hasNext()) {