code: public OptionElement parseOptions(final InputStream is) throws OptionsException{
      Reader rdr = null;
  
      try {
        rdr = new InputStreamReader(is);
  
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(false);
  
        DocumentBuilder builder = factory.newDocumentBuilder();
  
        Document doc = builder.parse(new InputSource(rdr));
  
        /* We expect a root element named as specified */
  
        Element root = doc.getDocumentElement();
  
        if (!root.getNodeName().equals(outerTag.getLocalPart())) {
          throw new OptionsException("org.bedework.bad.options");
        }
  
        OptionElement oel = new OptionElement();
        oel.name = "root";
  
        doChildren(oel, root, new Stack<Object>());
  
        return oel;
      } catch (OptionsException ce) {
        throw ce;
      } catch (Throwable t) {
        throw new OptionsException(t);
      } finally {
        if (rdr != null) {
          try {
            rdr.close();
          } catch (Throwable t) {}
        }
      }
    }
docs: Parse the input stream and return the internal representation.
  
  @param is         InputStream
  @return OptionElement root of parsed options.
  @exception OptionsException Some error occurred.