Here is a pure XSLT 1.0 solution that doesn't use any extensions:
Test
|
|
when this transformation is applied on the provided XML document:
testFizz
testBar
testLib
testFizz2
testBar2
testLib2
the wanted, correct result is produced:
Test
Foo Bar |
Fizz |
testBar |
testFizz |
testBar2 |
testFizz2 |