I don't think position() function can be used in this way to get the index of an element in a leaf-list. The problem is that the position() function indicates a position of the node in the currently selected node-set, and *not* a position in a list o...