1 // function library
2
3 def "func:distinctName" {
4 param "nodes", "/..";
5 choose {
6 when "not($nodes)"
7 result "/..";
8 otherwise {
9 result "$nodes[1] | func:distinctName($nodes[position() > 1])[@name != $nodes[1]/@name]";
10 }
11 }
12 }