if (output == null) {
throw new IllegalStateException("No report output set.");
}
final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
outputEncoding, true, output.createFile());
return new XMLReportNodeHandler(root, rootNode) {
@Override
protected void insertElementsBefore(final XMLElement element)
throws IOException {
writeSessionInfos(element, sessionInfos);
}