code: protected Statement parseStatementSettings(XMLStreamReader reader) throws XMLStreamException, ParserException,
        ValidateException
     {
  
        Long preparedStatementsCacheSize = null;
        Boolean sharePreparedStatements = Defaults.SHARE_PREPARED_STATEMENTS;
        TrackStatementsEnum trackStatements = null;
  
        Map<String, String> expressions = new HashMap<String, String>();
  
        while (reader.hasNext())
        {
           switch (reader.nextTag())
           {
              case END_ELEMENT : {
                 if (XML.ELEMENT_STATEMENT.equals(reader.getLocalName()))
                 {
                    return new StatementImpl(sharePreparedStatements, preparedStatementsCacheSize, trackStatements,
                            !expressions.isEmpty() ? expressions : null);
                 }
                 else
                 {
                    switch (reader.getLocalName())
                    {
                       case XML.ELEMENT_PREPARED_STATEMENT_CACHE_SIZE :
                       case XML.ELEMENT_TRACK_STATEMENTS :
                       case XML.ELEMENT_SHARE_PREPARED_STATEMENTS :
                          break;
                       default :
                          throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName()));
                    }
                 }
                 break;
              }
              case START_ELEMENT : {
                 switch (reader.getLocalName())
                 {
                    case XML.ELEMENT_PREPARED_STATEMENT_CACHE_SIZE : {
                       preparedStatementsCacheSize = elementAsLong(reader, XML.ELEMENT_PREPARED_STATEMENT_CACHE_SIZE,
                                                                   expressions);
                       break;
                    }
                    case XML.ELEMENT_TRACK_STATEMENTS : {
                       String elementString = elementAsString(reader, XML.ELEMENT_TRACK_STATEMENTS, expressions);
                       trackStatements = TrackStatementsEnum.valueOf(elementString == null ? "FALSE" : elementString
                          .toUpperCase(Locale.US));
                       break;
                    }
                    case XML.ELEMENT_SHARE_PREPARED_STATEMENTS : {
                       sharePreparedStatements = elementAsBoolean(reader, XML.ELEMENT_SHARE_PREPARED_STATEMENTS,
                                                                  expressions);
                       break;
                    }
                    default :
                       throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                 }
                 break;
              }
           }
        }
        throw new ParserException(bundle.unexpectedEndOfDocument());
     }
docs: Parse statement
  @param reader The reader
  @return The result
  @exception XMLStreamException XMLStreamException
  @exception ParserException ParserException
  @exception ValidateException ValidateException