docs: public static @Nonnull Document parse(@Nonnull Reader stream) throws SAXException, IOException {
          DocumentBuilder docBuilder;
  
          try {
              docBuilder = newDocumentBuilderFactory().newDocumentBuilder();
              docBuilder.setEntityResolver(RestrictiveEntityResolver.INSTANCE);
          } catch (ParserConfigurationException e) {
              throw new IllegalStateException("Unexpected error creating DocumentBuilder.", e);
          }
  
          return docBuilder.parse(new InputSource(stream));
      }