Note to self: when working in XQuery/eXist and having trouble with XPath queries, check for "default namespace" declaration at the top of the document and modify the XPath accordingly. Remember that the default namespace will be applied to all elements in XPath queries in that document unless explicitly stated otherwise (or unless the default namespace is deleted).