ICloneable c = (ICloneable)message;
IBaseMessage outMsg = (IBaseMessage)c.Clone();
streamOut.Position = 0;
outMsg.BodyPart.Data = streamOut;
// Clean up resources
pipelineContext.ResourceTracker.AddResource(outMsg.BodyPart.Data);
return outMsg;