Witam
mam typ mapgroup w ktorym są 3 elementy:

<xs:complexType name="mapgroup">
xs:all
<xs:element name="name" type="xs:string"/>
<xs:element name="layers" type="layers" maxOccurs="1" minOccurs="0"/>
<xs:element name="mapgroups" type="mapgroups" maxOccurs="1" minOccurs="0"/>
</xs:all>
</xs:complexType>

chciałbym by niezależne od kolejności były takie wystąpienia:

name zawsze
layers mogło wystąpić 0 lub 1
mapgroups 0 lub 1

Jednak chce zrobić tak by suma wystąpień layers i mapgroups była minimum 1 max 2

Czy ktoś wie jak to zrobić?