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, the PUL. At the end of a query, all update primitives on this list are applied in a strict order after some compatibility tests. If a conflict exists, an error message is returned and all accessed databases remain untouched (atomicity). For the user this means updates are only visible <b>after</b> the end of a snapshot. I we have the document:
<pre><doc> <a/> </doc>
... and perform the following query:
Our result looks like this:
<pre><doc> <justRenamed/><b/> </doc>
This concept dictates the way you can access query results. [[Update#Returning Results|Returning Results]] is dedicated to this issue.