This video defines and explains the use of GroupBy function which is more often not deeply understood for its feature and use case. This video explains the step by step exploration and anatomy of GroupBy with simple 'Employees' example so that we can understand easily.
The demo uses the GroupBy using one field, you can try grouping based on any other fields available in the XML. The details are given below:
The below link provides the Sample Employee Input XML used in the Demo:
https://drive.google.com/file/d/1G598...
The Below Link Provides the DataWeave snippet with GroupBy:
https://drive.google.com/file/d/1eKFx...