properties.put("method", "xml");
transformerHandler.getTransformer().setOutputProperties(properties);
transformerHandler.setResult(new StreamResult(outputStream));
transformerHandler.startDocument();
saxBuffer.toSAX(new EmbeddedSAXPipe(transformerHandler));
transformerHandler.endDocument();
} catch (Exception e) {
throw new ProcessingException("Can't stream the provided SaxBuffer.", e);
}
}