update on a fragment, which would raise an error if applied on a database node.</p>
;Example 1: : Query: <pre>insert node attribute id{'1'} into <a id='0'/></pre>
: Result:
;Example 2: : Query: <pre>insert node attribute id{'0'} into doc('doc.xml')//n</pre>
: File 'doc.xml': <code><n id='1'/></code>
: Result: <code>[XUDY0021] Duplicate attribute "id".</code>
<code>fn:put()</code>. If this functionality is required, the transform expression can be applied.
The copied nodes in a transform expression are internally treated like database nodes
and are updatable as a result.</p> <blockquote> <p><b>;Example1:</b></p> <p><b>: Query:</b></p> <pre>let $n := <n/>
return (insert node <x/> into $n, put($n,'doc.xml'))
</pre> <p><b>: Resulting File 'doc.xml':</b> <code><n/></code></p> <p><b>;Example 2: : Query:</b></p> <pre>put(
copy $nn := <n/>
modify insert node <x/> into $nn
return $nn,
'doc.xml')
</pre> <p><b>: Resulting File 'doc.xml':</b><code> <n> <x/> </n></code></p> </blockquote>