code: public void setResult(Result result) throws IllegalArgumentException
    {
  
      if (null == result)
        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null");
  
      try
      {
  //      ContentHandler handler =
  //        m_transformer.createResultContentHandler(result);
  //      m_transformer.setContentHandler(handler);
          SerializationHandler xoh = 
              m_transformer.createSerializationHandler(result);
          m_transformer.setSerializationHandler(xoh);
      }
      catch (javax.xml.transform.TransformerException te)
      {
        throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set");
      }
  
      m_result = result;
    }
docs: Enables the user of the TransformerHandler to set the
  to set the Result for the transformation.
  
  @param result A Result instance, should not be null.
  
  @throws IllegalArgumentException if result is invalid for some reason.