code: public Activations parse(XMLStreamReader reader) throws Exception
     {
  
        Activations adapters = null;
  
        //iterate over tags
        int iterate;
        try
        {
           iterate = reader.nextTag();
        }
        catch (XMLStreamException e)
        {
           //founding a non tag..go on. Normally non-tag found at beginning are comments or DTD declaration
           iterate = reader.nextTag();
        }
        switch (iterate)
        {
           case END_ELEMENT : {
              // should mean we're done, so ignore it.
              break;
           }
           case START_ELEMENT : {
  
              switch (reader.getLocalName())
              {
                 case XML.ELEMENT_RESOURCE_ADAPTERS : {
                    adapters = parseResourceAdapters(reader);
                    break;
                 }
                 default :
                    throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
              }
  
              break;
           }
           default :
              throw new IllegalStateException();
        }
  
        return adapters;
  
     }
docs: {@inheritDoc}