ResultHandler resultHandler = resultHandlerFactory.createResult(exchange);
Result result = resultHandler.getResult();
// lets copy the headers before we invoke the transform in case they modify them
Message out = exchange.getOut();
out.copyFrom(exchange.getIn());
// the underlying input stream, which we need to close to avoid locking files or other resources
InputStream is = null;
try {
Source source;