1. A method for executing a function in an XPath-based query requesting data from a markup language document stored in a database, the markup language document organized hierarchically into nodes, the method comprising: receiving the XPath-based query requesting data from the markup language document, the XPath-based query including an XPath built-in function that operates within a particular context of the markup language document during execution of the XPath-based query; during execution of the XPath-based query: determining nodes of the markup language document satisfying the XPath-based query, wherein determinina nodes the markup language document satisfying the XPath-based query includes determining node identifiers, deriving values of said nodes of the markup language document, and executing the XPath built-in function with said derived values and said nodes of the markup language document.
7. The method of claim 1 , wherein said determining step includes generating a plan for obtaining data requested by the query.