ByteArrayOutputStream baos = new ByteArrayOutputStream();
Result result = new StreamResult(baos);
transformer.transform(source, result);
return new ByteArrayResource(baos.toByteArray());
} catch (Exception e) {
throw new ResourceNotFoundException("Could not apply XSLT \"" + xsltResName + "\" to resource \""
+ xmlResName + "\"", e);
}
}