[ADD] XQuery optimizations: add leading root expression. Closes #955