File: Data.xml
title 1
Enter
I
A
A
C
B
H
A
File: Transform.xslt
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
group-adjacent="if (self::SPEAKER) then 0 else 1">
group-adjacent="if (self::SPEAKER)
then 'SPEAKERS' else 'LINES'">
Output:
title 1
title 1
Enter
I
A
A
C
B
H
A