1. An event handler method for resolving ambiguity in a search of a tree data structure having a plurality of nodes, the ambiguity occurring when a searched value occurs at two or more nodes of the tree data structure, the method comprising: a processor determining weighted distances between a context node and two or more candidate nodes, each candidate node containing the searched value, where the weighted distance equals the number of downward steps from the context node to a candidate node multiplied by a first constant plus the number of upward steps from the context node to the candidate node multiplied by a second constant; the processor selecting a node having a desired weighted distance; and the processor returning information from the selected node.