In this case, the original database node remains untouched as well, as all updates are performed on the node copy.
Here is an example where we return an entire document, parts modified
and all:
<pre class="brush:xml">
copy $c := doc("zaokeng.kml")
modify (
for $d in $c//*:Point
return insert node (
<extrude>1</extrude>,
<altitudeMode>relativeToGround</altitudeMode>
) before $d/*:coordinates
)
return $c
</pre>
===Functions===