code: protected Validation parseValidation(XMLStreamReader reader) throws XMLStreamException, 
        ParserException, 
        ValidateException
     {
        Boolean validateOnMatch = Defaults.VALIDATE_ON_MATCH;
        Boolean useFastFail = Defaults.USE_FAST_FAIL;
        Boolean backgroundValidation = Defaults.BACKGROUND_VALIDATION;
        Long backgroundValidationMillis = null;
  
        Map<String, String> expressions = new HashMap<String, String>();
  
        while (reader.hasNext())
        {
           switch (reader.nextTag())
           {
              case END_ELEMENT : {
                 switch (reader.getLocalName())
                 {
                    case CommonXML.ELEMENT_VALIDATION :
                       return new ValidationImpl(validateOnMatch, backgroundValidation, backgroundValidationMillis,
                          useFastFail,
                               !expressions.isEmpty() ? expressions : null);
                    case CommonXML.ELEMENT_VALIDATE_ON_MATCH :
                    case CommonXML.ELEMENT_BACKGROUND_VALIDATION_MILLIS :
                    case CommonXML.ELEMENT_BACKGROUND_VALIDATION :
                    case CommonXML.ELEMENT_USE_FAST_FAIL :
                       break;
                    default :
                       throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName()));
                 }
              }
              case START_ELEMENT : {
                 switch (reader.getLocalName())
                 {
                    case CommonXML.ELEMENT_VALIDATE_ON_MATCH : {
                       validateOnMatch = elementAsBoolean(reader, CommonXML.ELEMENT_VALIDATE_ON_MATCH, expressions);
                       break;
                    }
                    case CommonXML.ELEMENT_BACKGROUND_VALIDATION_MILLIS : {
                       backgroundValidationMillis = elementAsLong(reader, CommonXML.ELEMENT_BACKGROUND_VALIDATION_MILLIS,
                                                                  expressions);
                       break;
                    }
                    case CommonXML.ELEMENT_BACKGROUND_VALIDATION : {
                       backgroundValidation = elementAsBoolean(reader, CommonXML.ELEMENT_BACKGROUND_VALIDATION,
                                                               expressions);
                       break;
                    }
                    case CommonXML.ELEMENT_USE_FAST_FAIL : {
                       useFastFail = elementAsBoolean(reader, CommonXML.ELEMENT_USE_FAST_FAIL, expressions);
                       break;
                    }
                    default :
                       throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
                 }
                 break;
              }
           }
        }
        throw new ParserException(bundle.unexpectedEndOfDocument());
     }
docs: Parse validation
  @param reader The reader
  @return The result
  @throws XMLStreamException XMLStreamException
  @throws ParserException ParserException
  @throws ValidateException ValidateException