If a query has two bindings for the same namespace
prefix, one in the query prolog and one in an element
constructor, then any operation that does run-time
prefix resolution (for example, a direct element
constructor) will use the binding from the prolog in
preference to the inner binding.
Source code fixed, test cases added.