Is there a way to get a local copy of the database node so that we do not 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)?
You could try the XQuery Update transform expression [1]:
copy $a := <your-result/> modify () return $a