 length
    ByteArrayOutputStream out = new ByteArrayOutputStream();

    //Setup FOP
    Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);

    //Setup Transformer
    Source xsltSrc = new StreamSource(new File("foo-xml2fo.xsl"));
    Transformer transformer = tFactory.newTransformer(xsltSrc);

    //Make sure the XSL transformation's result is piped through to FOP
    Result res = new SAXResult(fop.getDefaultHandler());

    //Setup input
    Source src = new StreamSource(new File("foo.xml"));

  