A computer-implemented method comprising: for a plurality of hierarchical data objects, generating a plurality of tokens by at least parsing each hierarchical data object of said plurality of hierarchical data objects, each token of said plurality of tokens being associated with a token location within a hierarchical data object of said plurality of tokens; generating a hierarchy-value index that indexes said plurality of tokens, said hierarchy-value index mapping each token of said plurality of tokens to respective one or more token locations within respective one or more hierarchical data objects of said plurality of hierarchical data objects, each respective one or more token locations being expressed as a token number or a token range defined by a beginning token number and an end token number, each token number representing an order of said each token among tokens within a hierarchical data object of said respective one or more hierarchical data objects; wherein said plurality of tokens comprise: non-leaf tokens that each correspond to a tag name node in said plurality of hierarchical data objects; leaf tokens that each correspond to a value comprising a data node in a hierarchical data object of said plurality of hierarchical data objects; wherein each token location of said non-leaf tokens contains a token location of a leaf token of said leaf tokens in a hierarchical data object of said plurality of hierarchical data objects; further including evaluating a path expression based on said hierarchy-value index and token containment between said leaf tokens and said non-leaf tokens, wherein token containment based on token locations, which indicates whether a token location of a token contains a token location of another token, is used to determine containment relationships between nodes in a hierarchical data object of said plurality of hierarchical data objects. for a plurality of hierarchical data objects, generating a plurality of tokens by at least parsing each hierarchical data object of said plurality of hierarchical data objects, each token of said plurality of tokens being associated with a token location within a hierarchical data object of said plurality of tokens; generating a hierarchy-value index that indexes said plurality of tokens, said hierarchy-value index mapping each token of said plurality of tokens to respective one or more token locations within respective one or more hierarchical data objects of said plurality of hierarchical data objects, each respective one or more token locations being expressed as a token number or a token range defined by a beginning token number and an end token number, each token number representing an order of said each token among tokens within a hierarchical data object of said respective one or more hierarchical data objects; wherein said plurality of tokens comprise: non-leaf tokens that each correspond to a tag name node in said plurality of hierarchical data objects; leaf tokens that each correspond to a value comprising a data node in a hierarchical data object of said plurality of hierarchical data objects; wherein each token location of said non-leaf tokens contains a token location of a leaf token of said leaf tokens in a hierarchical data object of said plurality of hierarchical data objects; non-leaf tokens that each correspond to a tag name node in said plurality of hierarchical data objects; leaf tokens that each correspond to a value comprising a data node in a hierarchical data object of said plurality of hierarchical data objects; wherein each token location of said non-leaf tokens contains a token location of a leaf token of said leaf tokens in a hierarchical data object of said plurality of hierarchical data objects; further including evaluating a path expression based on said hierarchy-value index and token containment between said leaf tokens and said non-leaf tokens, wherein token containment based on token locations, which indicates whether a token location of a token contains a token location of another token, is used to determine containment relationships between nodes in a hierarchical data object of said plurality of hierarchical data objects.