Certain restrictions apply to defining attributes as sub-elements:
1.The ‘choice’ particle cannot be used – only ‘sequence’ or ‘group’
2.A sequence can contain only elements or groups (i.e., no ‘any’, ‘choice’ or other ‘sequence)’.
3.The elements must have a maxOccurs value of 1 (that is the default).
4.The element must have a minOccurs of either 0 – that means that the corresponding object attribute is optional or 1 –indicating that the corresponding object attribute is compulsory.
5.The element can be declared nillable (‘nillable=”true”’). In such a case, the corresponding object attribute is always optional, regardless of the value of minOccurs.
NOTE
If groups are used they must follow the same rules: do not use the ‘choice’ particle and contain a sequence of elements and/or other groups.