2.5. Example of Xdefinition with groups

In the Xdefinition below, the groups "xd:mixed" and "xd:choice" are listed:
<xd:def xmlns:xd="http://www.xdef.org/xdef/4.2" xd:name =FO" xd:root="Family | Owner" >
  <Family>
      <Father xd:script="optional; ref Person;" />
      <Mother xd:script="required; ref Person;" />
        <xd:mixed>
           <Son      xd:script="occurs *; ref Person;" />
           <Daughter xd:script="occurs *; ref Person;" />
        </xd:mixed>
     <Address xd:script="ref Address;" />
  </Family>
  
  <Owner>
      <xd:choice>
         <Person  xd:script="ref Person;" />
         <Company name="string();" />
      </xd:choice>
    <Address xd:script="ref Address;" />
  </Owner>
  
  <Person Firstname="string();" Familyname="string();" BirthDate="date();" />  
  <Address Street="string(1,30);" Number="optional int();" City="string();" />
</xd:def>
You can try it HERE