I am trying to create an XSD that validates the following XML structure
<SystemData>
<Item Value="Techno" ListType="Flat">
<Node Value="Detroit" />
<Node Value="Gabba" />
</Item>
<Item Value="House" ListType="Tree">
<Node Value="Deep">
<Node Value="New York" />
</Node>
<Node Value="Acid" />
<Node Value="Chicago" />
</Item>
</SystemData>
Basically there is a root SystemData elements that contains a sequence of Item elements that can contain a sequence of Node elements, each of which can contain a sequence of node elements, modelling a tree like structure to n levels
So I have come up with this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="SystemData">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Item">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Node">
<xs:complexType>
<xs:attribute name="Value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="Value" type="xs:string" use="required"/>
<xs:attribute name="ListType" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
How can I include the Node element as a sequence of itself?