final StringWriter writer = new StringWriter();
templates.newTransformer().transform(source, new StreamResult(writer));
return writer.toString();
} catch (TransformerException e) {
logger.error(e.getMessage());
throw new SchematronValidationException("Failed to apply Schematron validation transform", e);
}
}