  //Start the transformation and rendering process
    transformer.transform(src, res);

    //Prepare response
    response.setContentType("application/pdf");
    response.setContentLength(out.size());
    
    //Send content to Browser
    response.getOutputStream().write(out.toByteArray());
    response.getOutputStream().flush();</pre>
<div class="note">
<div class="label">Note</div>
<div class="content">
          Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential 
       