[FIX] XQuery: mandatory external variable declarations. Closes GH #833.