A requirement recently arose where I needed to have a sequence of optional elements foo1, foo2, foo3, foo4, f005 where an optional element bar was permitted between any one of the foo{n} elements.
The following definition demonstrates a definition for just such a case, where foo2 can have multiple occurrences.
<xsd:element name="container">
<xsd:complexType>
<xsd:sequence>
<xsd:choice minOccurs="0" >
<xsd:sequence>
<xsd:element ref="foo1"/>
<xsd:element ref="bar" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:sequence>
<xsd:element ref="foo2"/>
<xsd:element ref="bar" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
<xsd:choice minOccurs="0" >
<xsd:sequence>
<xsd:element ref="foo3"/>
<xsd:element ref="bar" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
<xsd:choice minOccurs="0" >
<xsd:sequence>
<xsd:element ref="foo4"/>
<xsd:element ref="bar" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>