// the length of the resulting XML file is unknown due to
// formatting: response.setContentLength(xml.length());
try {
Writer writer = new OutputStreamWriter(response.getOutputStream());
PlanStatisticsGenerator statstics = new PlanStatisticsGenerator(writer, em);
statstics.writeCompleteStatistics();
} catch (IOException e) {
facesMessages.addError("An error occured while generating statistics.");
log.error("An error occured while generating statistics.", e);
}