This is a tutorial on hierarchical structures, their semantics, and operational principles. It explains how nonprocedural 4GLs like SQL can process multi-leg structures automatically by utilizing the semantics in the structure being processed. The process of being able to process multi-leg queries automatically means that any query posed against a multi-leg structure can be processed nonprocedurally and the user does not have to be knowledgeable of the hierarchical structure.
XQuery being more procedural requires that hierarchical multi-leg query logic be specified to indicate how the multiple legs need to be related in order to properly hierarchically process the query. This means the coder of the query also has to be knowledgeable of the hierarchical structure being processed.
Multi-leg queries are hierarchically complex to process and require Lowest Common Ancestor (LCA) logic. Procedural queries require this logic to be specified externally, while nonprocedural queries perform this logic automatically internally. This tutorial describes this hierarchical processing and much more.