I'm exploring the possibility of writing a code coverage tool for XQuery. As part of this I'd like to be able to enumerate all the line numbers in an XQuery module that contain expressions.
I'll have a look at the code and see how hard this might be to add.