1. A method comprising performing a machine-executed operation involving instructions, wherein the machine-executed operation is at least one of: A) sending the instructions over transmission media; B) receiving the instructions over transmission media; C) storing the instructions onto a machine-readable storage medium; and D) executing the instructions; wherein the instructions are instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of: receiving a request to transform a set of one or more XML documents based on an XSLT stylesheet that includes calls to one or more transformation templates that each specifies how to transform one or more nodes in the set of one or more XML documents; determining, based on nodes contained in the set of one or more XML documents, which particular one or more templates to use to transform the set of one or more XML documents; and translating the XSLT stylesheet into a set of one or more XQuery language expressions, including converting calls to the particular one or more templates into calls to corresponding translated XQuery user-defined functions.