StringWriter writer = new StringWriter();
// Transform
Source xmlSource = new StreamSource(selectedXmlReportFile);
Result htmlTarget = new StreamResult(writer);
getLog().info("Transforming " + selectedXmlReportFile.getAbsolutePath() + ".");
ReportTransformer transformer = new HtmlReportTransformer();
try {
transformer.transform(xmlSource, htmlTarget);
} catch (ReportTransformerException e) {
throw new MavenReportException("Cannot transform report.", e);
}
getSink().rawText(writer.toString());
}