10. The method of claim 8 , wherein before executing the SQL/XML query, the method further comprises: determining how XML data, that is targeted by the SQL/XML query, can be accessed; generating, based on the SQL/XML query and how the XML data can be accessed, a rewritten query that indicates one or more data structures; and executing the rewritten query, wherein the one or more data structures are accessed to execute the rewritten query.
8. A method comprising: executing an SQL/XML query that includes a reference-based operator, wherein the reference-based operator includes a set of one or more operands that each refer to one or more nodes of an XML document, wherein the reference-based operator is one of a node comparison operator or an operator that requires context node traversal; wherein execution of the reference-based operator returns a reference to the one or more nodes instead of a value of the one or more nodes; wherein executing the SQL/XML query includes: determining a reference for each of the one or more nodes; and generating results of the SQL/XML query based on the-reference; wherein the steps are performed by one or more computing devices.