code: protected void renderXML(String xml, String xslt, HttpServletResponse response)
                  throws FOPException, TransformerException, IOException {
  
          //Setup sources
          Source xmlSrc = convertString2Source(xml);
          Source xsltSrc = convertString2Source(xslt);
  
          //Setup the XSL transformation
          Transformer transformer = this.transFactory.newTransformer(xsltSrc);
          transformer.setURIResolver(this.uriResolver);
  
          //Start transformation and rendering process
          render(xmlSrc, transformer, response);
      }
docs: Renders an XML file into a PDF file by applying a stylesheet
  that converts the XML to XSL-FO. The PDF is written to a byte array
  that is returned as the method's result.
  @param xml the XML file
  @param xslt the XSLT file
  @param response HTTP response object
  @throws FOPException If an error occurs during the rendering of the
  XSL-FO
  @throws TransformerException If an error occurs during XSL
  transformation
  @throws IOException In case of an I/O problem