Use generate-id() as link
File: Data.xml
Chapter 1
para 1
item 1
Chapter 2
item 2
For while they sit contriving, shall the rest
Chapter 3
para 2
para A
File: Transform.xslt
Table of Contents
Output:
Table of Contents
Chapter 1
Chapter 2
Chapter 3
Chapter 1
para 1
item 1
Chapter 2
item 2
For while they sit contriving, shall the rest
Chapter 3
para 2
para A