You've been declaring types inside the element declarations:
<xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="age" type="xs:integer"/> </xs:sequence> </xs:complexType> </xs:element>
But you can name a complex at the top-level types:
<xs:complexType name="Person"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="age" type="xs:integer"/> </xs:sequence> </xs:complexType>
And then you point to them with elements:
<xs:element name="person" type="my:Person"/> <xs:element name="student" type="my:Person"/> <xs:element name="parent" type="my:Person"/>
Keep in mind that types can't exist in a document without an element declaration.