I do not seem to be able to update/modify a DOM and return it using the same query. BaseX complains about update not being possible at that context...
let $x := <root/> return (insert node <x/> into $x, $x)
Is there a way to update and return the DOM using one query or is that not handled by xquery in general?