Hi Mike,
Yes, an unambiguous hierarchical structure can not have a given node type in more than one location in the structure. Each node type requires its own unique path to locate it. In that way each unique node type has its single semantics. In SQL, the hierarchical structure is stored in the result rowset. It can then be transformed into structured XML. SQL supports recursive structures; these are also represented in the result rowset. This is done without creating separate node types for each recursive data instance. It is treated internally like another node data occurrence. So there is no ambiguity problem with recursive structures in ANSI SQL. The transformation process then builds the output XML recursive structure.
In the recursive SQL structure depicted below, the B,C segment is recursive. It has been defined in ANSI SQL as recursive without creating additional node types; this is how it is viewed during SQL query processing (depicted below). There is no change of SQL processing, SELECT B.val, FROM ABCview WHERE C.val=2 will still work correctly regardless of how you view the structure, as it is depicted below in SQL or fully expanded in XML. The same ANSI SQL operation operates on recursive structures transparently eliminating additional user processing complexity.
A
| <-
B |
| |
C |
|__|
/Mike