[FIX] XQuery, xquery:eval and function items. Closes #662