1. A method for functional updating data represented in a tree comprising the steps of: receiving an indication of an XML file or an XML stream to update in an input tree; receiving an indication of an update combinator, the update combinator indicating nodes to match and a function to apply to nodes matching the update combinator; optimizing a query to search for matching nodes based on the input tree at least in part by utilizing an XML schema associated with the input tree to determine whether a search of an associated subtree can be skipped; finding at least one node in the input tree matching the update combinator using the optimized search; cloning one or more portions of the input tree that include a matching node corresponding to the update combinator; streaming portions of the input tree respectively corresponding to a matched node, wherein only a portion of the input tree is streamed into memory at any given time; updating a cloned portion of the at least one node in the input tree on a server by applying the function indicated by the update combinator; determining an amount of memory to be used based on a size of the input tree and an expected number of updates; and outputting an output tree comprising updated nodes.