code: public int parseToNode(Source source, SourceLocator locator, XPathContext xctxt)
            throws TransformerException
    {
  
      try
      {      
        Object xowner = xctxt.getOwnerObject();
        DTM dtm;
        if(null != xowner && xowner instanceof org.apache.xml.dtm.DTMWSFilter)
        {
          dtm = xctxt.getDTM(source, false, 
                            (org.apache.xml.dtm.DTMWSFilter)xowner, false, true);
        }
        else
        {
          dtm = xctxt.getDTM(source, false, null, false, true);
        }
        return dtm.getDocument();
      }
      catch (Exception e)
      {
        //e.printStackTrace();
        throw new TransformerException(e.getMessage(), locator, e);
      }
  
    }
docs: Try to create a DOM source tree from the input source.
  
  @param source The Source object that identifies the source node.
  @param locator The location of the caller, for diagnostic purposes.
  
  @return non-null reference to node identified by the source argument.
  
  @throws TransformerException if the source argument can not be resolved
  to a source node.