[MOD] XQuery: speeding up default namespace resolution
[MOD] XQuery: Speeding up "castable as" expressions. Closes #966