code: public boolean validate() {
          _validationError = null;
          List<XmlError> errors = new ArrayList<XmlError>();
  
          boolean valid = _xmlBean.validate(new XmlOptions().setErrorListener(errors));
          if (!valid) {
              _validationError = "";
              for (int i = 0; i < errors.size(); i++) {
                  _validationError += errors.get(i).toString();
                  if (i < errors.size() - 1)
                      _validationError += '\n';
              }
          }
  
          return valid;
      }
docs: Performs validation on the XmlBean, populating the error message if failed.
  @return false if the XmlBean is invalid (error message is available in getValidationError()).