File: Data.xml
First Chapter
Second Chapter
Subchapter 1
Subchapter 2
Third Chapter
Subchapter A
Subchapter B
sub a
sub b
Subchapter C
File: Transform.xslt
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Number
text
Output:
Number text 1 First Chapter 2
Second Chapter
1 Subchapter 1 2 Subchapter 2 3
Third Chapter
1 Subchapter A 2
Subchapter B
1 sub a 2 sub b 3 Subchapter C