1. A method for functional updating data represented in a tree: receiving an indication of 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 search for matching nodes based on the input tree; finding at least one node in the input tree matching the update combinator using the optimized search; for each matched node, cloning at least a portion of the input tree comprising the matched node; functionally updating the cloned portion of the tree by applying the indicated function; and indicating an output tree comprising the updated nodes.