It looks as though csvtoxml
is being called with a large string and it recursively works it's way through that string. position()
won't work in this case because you're not working with a set of nodes.
Instead you might be able to achieve what you're after with a counting param: