The following XML is given:
1 2 <
Consider the following example:
XSLT 1.0
Applying this to your XML input with a start-id parameter value of 6, will produce:
start-id
6
Result
To exclude the starting node and list only its ancestors, you could do: