Grouping using break-when
break-when attribute can be specified on
group-ending-with. This allows a new group to be started conditionally based on the contents
of the current group so far. For example,
break-when="@date lt $group[last()]/@date
causes a new group to be started whenever the date on the current item is earlier than the date on the
last item in the previous group.
For more details see xsl:for-each-group.