I have an xml datasource which looks like this:
You haven't shown your desired output. But in XSLT 2.0, you could do something like this: