System.out.println("done with parse: "+isource.getSystemId());
  public Node getDOMNode(Source source, SourceLocator locator)          throws TransformerException  {    if (source instanceof DOMSource)    {      return ((DOMSource) source).getNode();    }    Node doc = null;    try    {      // System.out.println("reading: "+source.getSystemId());      XMLReader reader = getXMLReader(source, locator);      // TODO: Need to use factory of some kind to create the ContentHandler      // (Also, try using JAXP if need be...)      ContentHandler handler = new SourceTreeHandler();      if (handler instanceof org.apache.xalan.stree.SourceTreeHandler)      {        // temp hack        ((org.apache.xalan.stree.SourceTreeHandler) handler).setUseMultiThreading(          false);      }      reader.setContentHandler(handler);      if (handler instanceof org.xml.sax.DTDHandler)        reader.setDTDHandler((org.xml.sax.DTDHandler) handler);      try      {        if (handler instanceof org.xml.sax.ext.LexicalHandler)          reader.setProperty("http://xml.org/sax/properties/lexical-handler",                             handler);        if (handler instanceof org.xml.sax.ext.DeclHandler)          reader.setProperty(            "http://xml.org/sax/properties/declaration-handler", handler);      }      catch (org.xml.sax.SAXException se){}      try      {        if (handler instanceof org.xml.sax.ext.LexicalHandler)          reader.setProperty("http://xml.org/sax/handlers/LexicalHandler",                             handler);        if (handler instanceof org.xml.sax.ext.DeclHandler)          reader.setProperty("http://xml.org/sax/handlers/DeclHandler",                             handler);      }      catch (org.xml.sax.SAXNotRecognizedException snre){}      InputSource isource = SAXSource.sourceToInputSource(source);System.out.println("parse: "+isource.getSystemId());      reader.parse(isource);System.out.println("done with parse: "+isource.getSystemId());      if (handler instanceof org.apache.xalan.stree.SourceTreeHandler)      {        doc = ((org.apache.xalan.stree.SourceTreeHandler) handler).getRoot();      }    }    catch (IOException ioe)    {      throw new TransformerException(ioe.getMessage(), locator, ioe);    }    catch (org.xml.sax.SAXException se)    {      throw new TransformerException(se.getMessage(), locator, se);    }    return doc;  }