code: public static Document readDocumentFromString(String s) throws Exception {
      InputSource in = new InputSource(new StringReader(s));
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(false);
      return factory.newDocumentBuilder().parse(in);
    }
docs: end class SAXErrorHandler