code: protected Capacity parseCapacity(XMLStreamReader reader) throws XMLStreamException, ParserException,
        ValidateException
     {
        Extension incrementer = null;
        Extension decrementer = null;
  
        while (reader.hasNext())
        {
           switch (reader.nextTag())
           {
              case END_ELEMENT : {
                 switch (reader.getLocalName())
                 {
                    case CommonXML.ELEMENT_CAPACITY :
                       return new CapacityImpl(incrementer, decrementer);
                    default :
                       break;
                 }
              }
              case START_ELEMENT : {
                 switch (reader.getLocalName())
                 {
                    case CommonXML.ELEMENT_INCREMENTER : {
                       incrementer = parseExtension(reader, CommonXML.ELEMENT_INCREMENTER);
                       break;
                    }
                    case CommonXML.ELEMENT_DECREMENTER : {
                       decrementer = parseExtension(reader, CommonXML.ELEMENT_DECREMENTER);
                       break;
                    }
                    default :
                       // Nothing
                 }
                 break;
              }
              default :
                 throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
           }
        }
        throw new ParserException(bundle.unexpectedEndOfDocument());
     }
docs: Parse capacity tag
  
  @param reader reader
  @return the parsed capacity object
  @throws XMLStreamException in case of error
  @throws ParserException in case of error
  @throws ValidateException in case of error