Recursion

XML permits recursion, where a message definition can contain self-referential structures.

In this example, the recursive node is gamma. The recursion is indicated through visual clues:

  • The plus sign (+) indicates the node is unexpanded.
  • The element name is not followed by any repetition or sequence information.

In this example, it is expanded twice. You can expand the tree infinitely, until the client machine's resources are exhausted. Consequently, this feature must be used with care. The expansion in this diagram provides user-access to the #text element contained within the third instance of gamma. Upon selection of a particular node, the path string is generated.