My Input XML File looks like\[code\]<test-message> <segment id="MSH"/> <segment id="SFT"/> <segment id="PID"/> <segment id="NTE"/> <segment id="NK1"/> <segment id="PV1"/> <segment id="ORC"/> <segment id="OBR"/> <segment id="NTE"/> <segment id="OBX"/> <segment id="NTE"/> <segment id="SPM"/> </test-message>\[/code\]in My above input XML file is optionalI want to group My input XML file based on or for above Input XML file I want to have below result when is present\[code\]<message-group> <test-message> <segment id="MSH"/> <segment id="SFT"/> <segment id="PID"/> <segment id="NTE"/> <segment id="NK1"/> <segment id="PV1"/></test-message><test-message> <segment id="ORC"/> <segment id="OBR"/> <segment id="NTE"/> <segment id="OBX"/> <segment id="NTE"/> <segment id="SPM"/> </test-message></message-group>\[/code\]for above Input XML file I want to have below result when is not present\[code\]<message-group> <test-message> <segment id="MSH"/> <segment id="SFT"/> <segment id="PID"/> <segment id="NTE"/> <segment id="NK1"/> <segment id="PV1"/></test-message><test-message> <segment id="OBR"/> <segment id="NTE"/> <segment id="OBX"/> <segment id="NTE"/> <segment id="SPM"/> </test-message></message-group>\[/code\]Can I have the XSLT (2.0) template or function to handle the above scenarioNote : I am making use of XSLT 2.0 and saxon parsers