}
public static void applyTransformation(InputStream xml, String xslResourceName, Writer resultWriter) {
URL url = XslTransformationUtils.class.getClassLoader().getResource(xslResourceName);
if (url == null) {
throw new ReportGenerationException("Can't find resource " + xslResourceName);
}
try (InputStream inputStream = url.openStream()) {
applyTransformation(new StreamSource(xml), new StreamSource(inputStream, url.toString()), resultWriter);
} catch (IOException e) {
throw new ReportGenerationException(e);
}
}