code: public TransformerHandler newTransformerHandler(Templates templates)
            throws TransformerConfigurationException
    {
      try {
        TransformerImpl transformer =
          (TransformerImpl) templates.newTransformer();
        transformer.setURIResolver(m_uriResolver);
        TransformerHandler th =
          (TransformerHandler) transformer.getInputContentHandler(true);
  
        return th;
      } 
      catch( TransformerConfigurationException ex ) 
      {
        if( m_errorListener != null ) 
        {
          try 
          {
            m_errorListener.fatalError( ex );
            return null;
          } 
          catch (TransformerConfigurationException ex1 ) 
          {
            throw ex1;
          }
          catch (TransformerException ex1 ) 
          {
            throw new TransformerConfigurationException(ex1);
          }
        }
        
        throw ex;
      }
      
    }
docs: Get a TransformerHandler object that can process SAX
  ContentHandler events into a Result, based on the Templates argument.
  
  @param templates The source of the transformation instructions.
  
  @return TransformerHandler ready to transform SAX events.
  @throws TransformerConfigurationException