String liaisonClassName = System.getProperty("org.apache.xalan.source.liaison");
  public Node getSourceTreeFromInput(XSLTInputSource inputSource)    throws org.xml.sax.SAXException  {    Node sourceTree = null;    String xmlIdentifier = ((null == inputSource) ||                            (null == inputSource.getSystemId()))                           ? "Input XML" : inputSource.getSystemId();        Source iSource = inputSource.getSourceObject();     if(iSource instanceof DOMSource)    {      //if(getXMLProcessorLiaison() instanceof org.apache.xalan.xpath.dtm.DTMLiaison)       // error(XSLTErrorResources.ER_CANT_USE_DTM_FOR_INPUT);      sourceTree = ((DOMSource)iSource).getNode();    }    else    {      // In case we have a fragment identifier, go ahead and      // try and parse the XML here.      try      {        diag("========= Parsing "+xmlIdentifier+" ==========");        pushTime(xmlIdentifier);                String liaisonClassName = System.getProperty("org.apache.xalan.source.liaison");        if(null != liaisonClassName)        {          DOM2Helper liaison =  (DOM2Helper)(Class.forName(liaisonClassName).newInstance());          liaison.parse(SAXSource.sourceToInputSource(iSource));          if(null != m_diagnosticsPrintWriter)            displayDuration("Parse of "+xmlIdentifier, xmlIdentifier);          sourceTree = liaison.getDocument();        }        else        {                XMLReader reader = XMLReaderFactory.createXMLReader();                  try          {            reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);          }          catch(SAXException se)          {          // What can we do?          // TODO: User diagnostics.          }                  // Get the input content handler, which will handle the           // parse events and create the source tree.                    //StylesheetHandler inputHandler = (StylesheetHandler)m_processor.getTemplatesBuilder();          //reader.setContentHandler( inputHandler );                    SourceTreeHandler handler = new SourceTreeHandler();          reader.setContentHandler(handler);          reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);                  // Kick off the parse.  When the ContentHandler gets           // the startDocument event, it will call transformNode( node ).          reader.parse( SAXSource.sourceToInputSource(iSource));          sourceTree = handler.getRoot();        }      }      catch(Exception e)      {        // Unwrap exception        if((e instanceof SAXException) && (null != ((SAXException)e).getException()))        {          // ((SAXException)e).getException().printStackTrace();          e = ((SAXException)e).getException();        }        sourceTree = null; // shutup compiler        error(XSLTErrorResources.ER_COULDNT_PARSE_DOC, new Object[] {xmlIdentifier}, e); //"Could not parse "+xmlIdentifier+" document!", e);      }    }    return sourceTree;  }