Compositions and Relations are mapped to elements in XML
Note:
Attributes were not chosen because they are just boiled down elements. Everything you can do with an attribute is possible with elements, but not the other way around.
XML defines a hierarchical model (a-cyclical graph). This restricts compositions from being related by multiple compositions.
Assume we have a family with a grandparent, a parent and a child.
The following relations hold:
this would map to the following XML document
<grandparent>
<haschild>
<parent>
<haschild>
<child/>
</haschild>
</parent>
</has>
</diputree>
Assume that we have two children, then we can use Canonical XML representation or Compressed XML notation
the Canonical mapping would result in the following XML document
<grandparent>
<haschild>
<parent>
<haschild>
<child/>
</haschild>
<haschild>
<child/>
</haschild>
</parent>
</has>
</diputree>
the Compressed mapping would result in the following XML document
<grandparent>
<haschild>
<parent>
<haschild>
<child/>
<child/>
</haschild>
</parent>
</has>
</diputree>
This looks like one relation with two objects. However these are actually two compressed relations each with only one object.