9. The computer program product of claim 7 , wherein the computer readable program when executed on a computer causes the computer to: for each document node in the hierarchical document that is a start event or an end event, add one or more LookingFor nodes to the LookingFor structure upon finding one or more document nodes in the hierarchical document described by one or more steps of the one or more paths in the query.
9. The computer program product of claim 7 , wherein the computer readable program when executed on a computer causes the computer to: for each document node in the hierarchical document that is a start event or an end event, add one or more LookingFor nodes to the LookingFor structure upon finding one or more document nodes in the hierarchical document described by one or more steps of the one or more paths in the query. 10. The computer program product of claim 9 , wherein the computer readable program when executed on a computer causes the computer to: in response to finding a document node of the hierarchical document described by an extraction step of the query, update the LookingFor node with a matched step instance identifier and building a step instance ancestor path of document nodes that lead to that first document node.