Here is the error that appears in the event viewer.
There was a failure executing the send pipeline: “<PipelineStrongName>” Source: “<PipelineComponentName>” Send Port: “<PortName ” URI: “<FullPathName>” Reason: Root element is missing.
On tracing it down, this is the code that was causing it:
public static Stream DoTransformation(IPipelineContext pContext, IBaseMessage message)
{
//….
Stream transformerdStream = TransformHelper.XsltTransform(message);
//Load the stream in an XML document for application logic
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(transformedStream);
//…. Application Logic here
return transformerdStream;
}
As the calling method calls uses the returned transformedStream the error is thrown.
Reason:
While loading the transformedStream in the xml document, the stream’s position is set to its “end”.
Solution:
1) Set the Stream’s position to ZERO, after the load
transformedStream.Seek(0, SeekOrigin.Begin);
2) Clone the original stream and then load the cloned stream in the Xml Document
Note: Another way to verify that the above error is to check the message details in the BizTalk Admin console. The body would appear empty.

Happy coding J