Recently I received a requirement where grouping and shorting in BizTalk map was required to get the desired result.
Here I have a sample message which has list of contacts and their items for an account. Multiple contact nodes are there for multiple items with same contact email address , first name and last name..
This message need to be transformed to a message with single node for a contact email address and all the items for a particular contact should be grouped within the contact.
The suggested way to accomplish this would be using xslt style sheet. You can refer Muenchian method.
I generally avoid using external XSL file or custom-XSLT because I am not very much comfortable with XSLT. So I tried to achieve this by using .net helper class.
I am not sure how would be the performance in case of dealing with large message but it work well for normal size messages.
Also this would be easily readable and maintainable in comparison with XSLT.
For a new BizTalk developer to troubleshoot and/or change an existing map it will be more easy to do using .net helper and BizTalk Mapper rather than troubleshoot and/or change and entire custom-XSLT file without a visual representation.