> Is there a way to get a local copy of the database node so that we do notYou could try the XQuery Update transform expression [1]:
> reference the node in the database for further usage in the xquery (any
> other cleaner way instead of iterating over the data and creating a local
> copy that foo:get-node-v2 is doing)?
copy $a := <your-result/> modify () return $a
[1] http://docs.basex.org/wiki/XQuery_Update#transform