code: public FilterRuleChain<String> parseChain(InputStream inStream) throws IOException, SAXException {
  
      try {
        Document xmlDoc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inStream);
        return parseChain(xmlDoc.getDocumentElement());
      } catch (ParserConfigurationException e) {
        throw new IllegalStateException("XML configuration error!", e);
      } finally {
        inStream.close();
      }
    }
docs: This method parses the chain from the given {@code inStream}. The XML contained in {@code inStream} needs to
  contain the chain rules as child-nodes of the {@link Document#getDocumentElement() root-element}. The name of the
  root-element is ignored (use e.g. "chain").
  
  @param inStream is the stream containing the XML to parse. It will be closed by this method (on success as well as
  in an exceptional state).
  @return the parsed filter rule.
  @throws IOException if an input/output error occurred.
  @throws SAXException if the {@code inStream} contains invalid XML.