Correct offset for iterator over XQuery arrays

Closes Issue #1047.