@Override
    public void startDocument() throws SAXException {
        this.outputStream = new ByteArrayOutputStream();
        handler.setResult(new StreamResult(outputStream));

        handler.startDocument();
        super.startDocument();
    }
@throws SAXException any SAX exception, possibly wrapping another exception
@see #endDocument
@see AbstractXMLFilter#startDocument()
stroom-pipeline/src/main/java/stroom/pipeline/filter/AbstractSamplingFilter.java