code: private static DocumentType getDocType(final InputStream body)
          throws IOException {
          final DocumentBuilderFactory factory =
              DocumentBuilderFactory.newInstance();
          try {
              factory.setFeature(RsPrettyXml.LOAD_EXTERNAL_DTD, false);
              final DocumentBuilder builder = factory.newDocumentBuilder();
              return builder.parse(body).getDoctype();
          } catch (final ParserConfigurationException | SAXException ex) {
              throw new IOException(ex);
          }
      }
docs: Parses the input stream and returns DocumentType built without loading
  any external DTD schemas.
  @param body The body to be parsed.
  @return The documents DocumentType.
  @throws IOException if something goes wrong.