There are lots of ways of solving a problem in XQuery. This sites examines a number of common tasks and ways in which each might be solved. Multiple solutions are numerically compared on execution time and raw length XQuery length.
Scripts are executed on eXist 2.2 Build 20141120.
A Kit Wallace