Hey, In the BaseX implementation this query: ($context//*[name() = $type and data((*|@*)[name() = $entityMetadata/property[@key = 'true']/@name]) = $entityId])[1] Will the query execute completely and then a 'subset' of 1 will be extracted, or will it only execute until it find the '1st' item that matches the query? Maybe this is a general XQuery question but I figured it was implementation specific. - James