1. A method of processing a query, comprising the computer-implemented steps of: receiving the query, wherein the query specifies certain operations to be performed, wherein the certain operations comprise a first set of one or more operations that are to be performed on a markup language data source; wherein the first set of one or more operations includes a second set of one or more operations; determining that the first set of one or more operations can be performed at any one of a plurality of entities; wherein the plurality of entities includes one or more of an XML database server, a relational database server, and a middle-tier engine; generating a plurality of execution plans for executing the query, wherein the plurality of execution plans include: a first execution plan indicating a first entity at which the second set of one or more operations are to be performed; and a second execution plan indicating a second entity at which the second set of one or more operations are to be performed; selecting, based on a particular set of criteria, a particular execution plan from the plurality of execution plans; wherein selecting the particular execution plan from the plurality of execution plans comprises one or more of: selecting the particular execution plan based at least in part on costs determined for the plurality of execution plans; and selecting the particular execution plan by using one or more rules to determine which execution plan, of the plurality of execution plans, to use for executing the query; wherein the selected particular execution plan indicates a first server at which the second set of one or more operations are to be performed; determining that a third set of one or more operations are to be performed at the middle-tier engine, wherein the first set of one or more operations include all operations in the third set of one or more operations, and the third set of one or more operations include no operation that are in the second set of one or more operations; sending a request to the first server to perform the second set of one or more operations; receiving a response to the request, wherein the response contains results of performing the second set of one or more operations on the markup language data source; and generating results for the query based at least in part on the results of performing the second set of one or more operations; wherein the steps of generating the plurality of execution plans and selecting the particular execution plan are performed by one or more computing devices.
1. A method of processing a query, comprising the computer-implemented steps of: receiving the query, wherein the query specifies certain operations to be performed, wherein the certain operations comprise a first set of one or more operations that are to be performed on a markup language data source; wherein the first set of one or more operations includes a second set of one or more operations; determining that the first set of one or more operations can be performed at any one of a plurality of entities; wherein the plurality of entities includes one or more of an XML database server, a relational database server, and a middle-tier engine; generating a plurality of execution plans for executing the query, wherein the plurality of execution plans include: a first execution plan indicating a first entity at which the second set of one or more operations are to be performed; and a second execution plan indicating a second entity at which the second set of one or more operations are to be performed; selecting, based on a particular set of criteria, a particular execution plan from the plurality of execution plans; wherein selecting the particular execution plan from the plurality of execution plans comprises one or more of: selecting the particular execution plan based at least in part on costs determined for the plurality of execution plans; and selecting the particular execution plan by using one or more rules to determine which execution plan, of the plurality of execution plans, to use for executing the query; wherein the selected particular execution plan indicates a first server at which the second set of one or more operations are to be performed; determining that a third set of one or more operations are to be performed at the middle-tier engine, wherein the first set of one or more operations include all operations in the third set of one or more operations, and the third set of one or more operations include no operation that are in the second set of one or more operations; sending a request to the first server to perform the second set of one or more operations; receiving a response to the request, wherein the response contains results of performing the second set of one or more operations on the markup language data source; and generating results for the query based at least in part on the results of performing the second set of one or more operations; wherein the steps of generating the plurality of execution plans and selecting the particular execution plan are performed by one or more computing devices. 16. The method of claim 1 , wherein the certain operations comprise a fourth set of one or more operations that are to be performed on a second data source; and wherein the method further comprises: determining that the first server is capable of performing the fourth set of one or more operations; determining that the first set of one or more operations require results from the fourth set of one or more operations; retrieving data related to the fourth set of one or more operations from the second data source; and performing a cost calculation to determine whether to request that the first server performs the fourth set of one or more operations; based at least in part on the cost calculation, performing one of: including the data related to the fourth set of one or more operations in the request sent to the first server; and performing, at the middle-tier engine, the fourth set of one or more operations on the data related to the fourth set of one or more operations; and including, in the request sent to the first server, the results of the middle-tier engine performing the fourth set of one or more operations on the data related to the fourth set of one or more operations.