Baril,
sorry, but I’m still not sure how to reproduce your use case.
let $raw-menu := app:open-db('en-us')/menu[@id = $menu-id]
Is app:open-db(...) equivalent to db:open(...) ?
Do you think that the following script is equivalent to what you do via RESTXQ?
<commands> <create-db name='en-us'/> <add path='devicehelp.xml'><menu id="devicehelp"/></add> <add path='smbonly.xml'><menu id="smbonly"/></add> <add path='ptt-help.xml'><menu id="ptt-help"/></add> <xquery><![CDATA[ db:replace('en-us', 'devicehelp.xml', <menu id="devicehelp"/>) ]]></xquery> <list name='en-us'/> </commands>
You can save this script using the ".bxs" suffix, and open and run it via the GUI or on command-line (basex script.bxs).
Christian