code: public final void parse(InputStream stream) throws IOException {
  
          // all XML exceptions are wrapped by IOExceptions
          try {
  
              // setup a namespace aware SAXParserFactory
              SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
              saxParserFactory.setNamespaceAware(true);
  
              // parse the input stream
              SAXParser parser = saxParserFactory.newSAXParser();
              parser.parse(stream, this);
  
          } catch (ParserConfigurationException e) {
              throw new IOException(e);
          } catch (SAXException e) {
              throw new IOException(e);
          }
  
      }
docs: Parses the supplied web.xml {@link InputStream}.
  
  @param stream The stream to parse
  @throws IOException for any errors during the parsing process