The case is not clear.
Is it like:
receive M1, M2 [- receive M2]... stop receiving M2 (when?)
??
The Xslt solution looks not so good for this case because of the looping.
It should be the unified convoy orchestration. On each cycle extract the desired value and add it to the total. That's all.
Leonid Ganeline [BizTalk MVP] Biztalkien blog