docs: private Document readDocument(byte[] xhtmlData) throws ParserConfigurationException, SAXException, IOException {
  
          DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
          docBuilderFactory.setValidating(false);
          docBuilderFactory.setNamespaceAware(true);
          DocumentBuilder docbuilder = docBuilderFactory.newDocumentBuilder();
          // use special entity resolver so we don't fetch the DTDs from w3.org, which would be slow
          docbuilder.setEntityResolver(m_entityResolver);
          Document doc = docbuilder.parse(new ByteArrayInputStream(xhtmlData));
          return doc;
      }