1. A computer-implemented document-searching method for searching a document having a hierarchical structure with elements separated by element identifiers, comprising the steps of: generating an XPATH query automaton, wherein XPATH is an XML (Extensible Markup Language) path for searching an XML document; wherein the XPATH query automaton is a table that contains a plurality of states of backward nodes, a condition for transition, and a search state; wherein a collection of entries of the XPATH query automaton expresses a state transition; wherein the generating the XPATH query automaton comprises steps of: generating and registering the state transition, wherein the generating and registering the state transition comprises: replacing an XPATH axis including an XPATH axis in a forward direction that is exemplified as an axis child, or a descendant in an XPATH into the state transition, replacing an XPATH axis including an XPATH axis in an opposite direction that is exemplified as axis parent, ancestor in an XPATH into the state transition, replacing an XPATH axis including an XPATH axis in a direction of a following-sibling, or a preceding-sibling in said XPATH into the state transition, replacement of a predicate of an XPATH into the state transition, replacement of a logical product AND of a predicate of an XPATH into the state transition, replacement of a logical add OR of a predicate of an XPATH into the state transition, replacement of a logical NOT of a predicate of an XPATH into the state transition, and wherein replacing and replacement keep an input XPATH query expression equal in terms of a search, and generates the XPATH query automaton including the plurality of states of the backward nodes, the condition for transition, and the search state, wherein the search state includes two states of said input XPATH query expression concurrently in the state transition, and wherein every axis regarding sibling relationship among nodes of the document is included in a condition for the XPATH query automaton; a query automaton evaluator determining the state transition of a node under determination by storing a left node and a lower node in correspondence with an identified element identifier, wherein information obtained from said left node and information obtained from said lower node for the state transition is used concurrently, and evaluating said XPATH query automaton with a search result of said left node and said lower node; storing the XPATH query automaton generated by a compiling device in a query automaton storage device; reading out the XPATH query automaton from said query automaton storage device and storing the XPATH query automaton while reading in said document and performing a stream search with the XPATH query automaton evaluator by using states of a plurality of different types of nodes in said element identifiers included in said document and said XPATH query automaton, thereby using two inputs and a search state; and storing an output of the query automaton evaluator in a result-storage device and thereafter outputting the stored output of the query automaton evaluator and the output of a searched node.