[MOD] gh-833, WIP
[FIX] XQuery: mandatory external variable declarations. Closes GH #833.