// prepare anything that might needed to be prepared ..
final String encoding = metaData.getConfiguration().getConfigProperty
("org.pentaho.reporting.engine.classic.core.modules.output.pageable.xml.Encoding",
EncodingRegistry.getPlatformDefaultEncoding());
final Writer writer = new BufferedWriter(new OutputStreamWriter(outputStream, encoding));
this.xmlWriter = new XmlWriter(writer, td);
this.xmlWriter.writeXmlDeclaration(encoding);
final AttributeList attrs = new AttributeList();
attrs.addNamespaceDeclaration("", XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE);
xmlWriter.writeTag(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "layout-output", attrs, XmlWriter.OPEN);