code: public void transform( InputStream xmlIS,
                             InputStream xslIS,
                             Map params,
                             OutputStream result,
                             String encoding) {
          try {
              TransformerFactory trFac = TransformerFactory.newInstance();
              Transformer transformer = trFac.newTransformer(new StreamSource(xslIS));
              Iterator it = params.keySet().iterator();
              while (it.hasNext()) {
                  String key = (String)it.next();
                  transformer.setParameter(key, (String)params.get(key));
              }
              transformer.setOutputProperty("encoding", encoding);
              transformer.transform(new StreamSource(xmlIS), new StreamResult(result));
          } catch (Exception e) {
              getLogger().severe("XmlHttpProxy: Exception with xslt " + e);
          }
      }
docs: Do the XSLT transformation