@SuppressWarnings("unused") //useful for debugging
    private String getBuffer() {
        CharBuffer charBuffer = null;
        try {
            stringWriter.flush();
            charBuffer = stringWriter.getBuffer();
        } catch (final RuntimeException e) {
            LOGGER.warn("Ignoring error {}", e.getMessage());
        }
        return charBuffer != null
                ? charBuffer.toString()
                : "";
    }
Only for use in debugging as it will flush the stringWriter
stroom-pipeline/src/main/java/stroom/pipeline/writer/XMLWriter.java