Im working with a hierarchial tool that has unlimited levels. Im trying to design a element that will build out infintely with tree nodes depending on the inbound data. There is basically 1 EID root, then below it there can be an unlmited tree build out. I want the xml structure to build out like the tree as well. I think Im just missing something simple.

<xs:complexType name="HierarchyEID">
<xs:sequence>
<xs:element name="organization" type="EMPIORG:HierarchyOrganization" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="value" type="xs:long"/>
<xs:attribute name="level">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="parent"/>
<xs:enumeration value="sibling"/>
<xs:enumeration value="child"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>


Im thinking the response will look like this with someone else added. This returns a list of treenodeelements. But you cant build into the tree nodes.

<xs:element name="HierarchialResponse">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="TreeNodeElement" type="EMPIORG:HierarchyEID"/>
</xs:sequence>
</xs:complexType>
</xs:element>

Thanks for any help