2.3. References and models of elements

XML data:

<Family>
    <Father   Firstname   = "John"  Familyname = "Smith" BirthDate = "1971-07-13" />
    <Mother   Firstname   = "Jane"  Familyname = "Smith" BirthDate = "1972-09-18" />
    <Son      Firstname   = "Peter" Familyname = "Smith" BirthDate = "1997-01-18" />
    <Daughter Firstname   = "Mary"  Familyname = "Smith" BirthDate = "1998-12-11" />
</Family>

References point to models of elements (note the occurrence limits are specified by the script) :

<xd:def xmlns:xd = "http://www.xdef.org/xdef/4.2" root = "Family">

<Family>
    <Father   xd:script = "optional; ref Person;" />
    <Mother   xd:script = "required; ref Person;" />
    <Son      xd:script = "occurs *; ref Person;" />
    <Daughter xd:script = "occurs *; ref Person;" />
</Family>

<Person Firstname = "string();" Familyname = "string();" BirthDate = "date();" />

</xd:def>
You can try it HERE