===Pending Update List===
The most important thing to keep in mind when using XQuery Update is the Pending Update List (PUL). Updating statements are not executed immediately, but are first collected as update primitives within a set-like structure. At the end of a query, after some consistency checksand optimizations, all the update primitives on this list are will be applied in the following order:
<pre class="brush:xml">
db:delete()
db:optimize()
db:drop()
db:create()
</pre>
If an inconsistency is found, an error message is returned and all accessed databases remain untouched (atomicity). For the user , this means that updates are only visible '''after''' the end of a snapshot.
====Example====