code: public static Document parse(InputStream is, EntityResolver resolver) {
  
          try {
              DocumentBuilder parser = createParser(resolver);
              return parser.parse(is);
          }
          catch (Exception e) {
              throw new PluginException("Error parsing XML document from input stream: " + e, e);
          }
      }
docs: Parse an XML document (with appropriate flags for our purposes) from the given stream.
  
  @param is input stream containing the document
  @param resolver resolver to be used for parsing
  
  @throws PluginException for all errors