Two problems with tracing in XQuery in 9.4:
(a) it is not activated by using -T on the command line (though it is activated by the relevant API calls)
(b) no trace output is produced for execution of the clauses of a FLWOR expression
A patch is being committed that solves (a) and provides a partial solution for (b). Specifically, it solves (b) in the case where the FLWOR expression can be rewritten as a nested set of FOR expressions and LET expressions, which happens when the only clauses in the FLWOR expression are FOR, LET, WHERE, and RETURN.
Tracing of the new model of FLWOR expression evaluation, whereby the clauses are evaluated in a pipeline performing progressive evaluation of the stream of tuples, requires further study.