The XQuery semantics are (largely) functional. Does this open the door for optimizations that have been developed in the domain of compilers for functional programming languages? One such ''functional gem'' could be memoization of expression values. In the simple XQuery expression below for $x in (1,2,2) for $y in (3,4,3) return e($x,$y) the nested FLWOR will lead to a 9-fold evaluation of expression e (in which variables $x and $y occur free). Alas, only four distinct variable binding pairs will be generated by the nested FLWOR. Can we evaluate (the potentially costly) expression e only 4 times and then later ''compensate'' for this optimization to ensure that the resulting sequence will be of length 9? Of course, one challenge is the ''(largely)'' above... If e contains side-effecting constructors, for example, memoization (re-using the results of e) might be unsound or at least complicated to achieve. Interestingly, memoization *should* go well together with the current formulation of the XQuery Update Draft, if the compensation action is performed in a sensible fashion. Are there more techniques we could adopt from the FP languages/compilers domain? Judging by his presentation's title, I should talk to Kris Rose. ;-)