code: public Connector parse(XMLStreamReader reader) throws Exception
     {
        Connector connector = null;
  
        try
        {
           //iterate over tags
           int iterate;
           try
           {
              iterate = reader.nextTag();
           }
           catch (XMLStreamException e)
           {
              //found 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 : {
                 if ("1.7".equals(reader.getAttributeValue(null, XML.ATTRIBUTE_VERSION)))
                 {
                    switch (reader.getLocalName())
                    {
                       case XML.ELEMENT_CONNECTOR : {
                          connector = parseConnector17(reader);
                          break;
                       }
                       default :
                          throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                    }
  
                 }
                 else if ("1.6".equals(reader.getAttributeValue(null, XML.ATTRIBUTE_VERSION)))
                 {
                    switch (reader.getLocalName())
                    {
                       case XML.ELEMENT_CONNECTOR : {
                          connector = parseConnector16(reader);
                          break;
                       }
                       default :
                          throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                    }
  
                 }
                 else if ("1.5".equals(reader.getAttributeValue(null, XML.ATTRIBUTE_VERSION)))
                 {
                    switch (reader.getLocalName())
                    {
                       case XML.ELEMENT_CONNECTOR : {
                          connector = parseConnector15(reader);
                          break;
                       }
                       default :
                          throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                    }
                 }
                 else
                 {
                    switch (reader.getLocalName())
                    {
                       case XML.ELEMENT_CONNECTOR : {
                          connector = parseConnector10(reader);
                          break;
                       }
                       default :
                          throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                    }
                 }
  
                 break;
              }
              default :
                 throw new IllegalStateException();
           }
        }
        finally
        {
           if (reader != null)
              reader.close();
        }
        return connector;
     }
docs: {@inheritDoc}