code: public synchronized Node parse(InputStream in) throws IOException, SAXException {
          //_dtd=null;
          Handler handler = new Handler();
          XMLReader reader = _parser.getXMLReader();
          reader.setContentHandler(handler);
          reader.setErrorHandler(handler);
          reader.setEntityResolver(handler);
          _parser.parse(new InputSource(in), handler);
          if (handler.error != null)
              throw handler.error;
          Node root = (Node)handler.root;
          handler.reset();
          return root;
      }
docs: Parse XML from InputStream.