> Allowing arbitrary strings as keys is definitely helpful.
I see advantages and drawbacks for both approaches. Maybe it is also sufficient to restrict the character set of keys to those of element names (i.e., NCNames)?
> Thinking of possible use cases, one might use something like the below example to find all documents with a specific property value:
>
> for $a in db:properties('testdb')[properties/property[@name = 'prop1'][string() = 'value1']
> return if (db:is-xml('testdb', $a/@resource)) then db:open('testdb', $a/@resource) else ()
Right. Here's one (of many) more way(s) to put it:
let $db := 'testdb'
let $path := db:properties($db)[prop1 = 'value1']/@resource[db:is-xml($db, .)]
return db:open('testdb', $path)