==Functions==
===Built-in Functions===
{{Code|fn:put()}} is can be used to serialize XDM instances to secondary storage. It is executed at the end of a snapshot. Serialized documents therefore reflect all changes made effective during a query.
Additional [[Database Module#Updates|database functions]] exist for performing updates on document and database level.
===User-Defined Functions===
To use updating expressions within a user-defined or anonymous function, the {{Code|%updating}} annotation has to be added before the {{Code|function}} keyword. A correct declaration of a function that contains updating expressions (or one that calls updating functions) looks like this: