> db:name((*)[1])

This should be faster:

  db:name(.[1])

There is probably no other way to do it, because multiple databases may be opened via XQuery at the same time.

>
>  
>
>  
>
>
> ________________________________
>
> Elsevier B.V. Registered Office: Radarweg 29, 1043 NX Amsterdam, The Netherlands, Registration No. 33156677, Registered in The Netherlands.