I am trying to group sibling data in an XML file.
Given :
Here is my attempt. One assumption I have made which simplifies things is that timeline elements with a specific text value are already unique.
The above is edited to use current() instead of a variable as per Tomalak's suggestion.