Hierarchical loops are a way for EDI transactions to dynamically define the looping structure. The standard defines all segments which might be a part of a hierarchical loop but it is the application/standard data being received which adds structure to those segments. For example, an HL loop would be defined to contain segments A, B, C, D, E, but it is the application/standard data which defines that segments A,B,C form one level 1 inner loop, that segments D,E form another level 1 inner loop, and that segments D,E might form a level 2 inner loop within the A,B,C loop. Theoretically there is no limit to the nesting levels.
HL loops may be qualified and mapped using the usual qualification and mapping methods. However, WebSphere Partner Gateway's HL support allows you to define Hierarchical levels and specify unique mapping instructions for each identifiable group of structures in a hierarchical level (loop).