SourceTransformer sourceTransformer = new SourceTransformer();
// Only DOMSource and SAXSource are allowed for validating
// See http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/Validator.html#validate(javax.xml.transform.Source,%20javax.xml.transform.Result)
// As we expect a DOMResult as output, we must ensure that the input is a
// DOMSource
DOMSource src = sourceTransformer.toDOMSource(out.getContent());
doValidation(validator,src,result);
if (errorHandler.hasErrors()) {
Fault fault = exchange.createFault();
// Dont set the schema and source document as properties on the fault