File: Data.xml
A
A key
.
B
C
D
E
F.
B
G
H
T
I
File: Transform.xslt
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Grouping with group-adjacent
group-adjacent="boolean(self::p)">
Output:
Grouping with group-adjacent
A
- A
key
.
- B
- C
- D
- E
- F.
B
- G
- H
- T
- I