1. A method comprising: receiving a query expression against a collection of XML documents stored in one or more tables of a database, wherein the collection of XML documents are stored based on a particular data storage format; determining that the query expression contains an updating expression that conforms to a language for querying XML documents; in response to determining that the query expression contains an updating expression, rewriting the query expression to form a first rewritten query expression comprising one or more path-based query operators that specify operations for updating XML data; based on the particular database storage format storing the collection of XML documents, rewriting the first rewritten query expression to form a second rewritten query expression comprising one or more storage format specific query operators configured to update particular XML data of the collection of XML documents; and wherein the method is performed by one or more computing devices.