code: public boolean isInstanceValid(Source instance) {
          try {
              return validator.validateInstance(instance).isValid();
          } catch (XMLUnitException e) {
              throw new XMLUnitRuntimeException(e.getMessage(), e.getCause());
          }
      }
docs: Is the given schema instance valid according to the configured
  schema definition(s)?
  
  @throws XMLUnitRuntimeException if the schema definition is
  invalid or the Source is a SAXSource and the underlying
  XMLReader throws an IOException (see {@link
  javax.xml.validation.Validator#validate validate in
  Validator}).