Listing 1

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="www.example.org/people"
xmlns:sdo="commonj.sdo" xmlns:sdoxml="commonj.sdo/xml"
xmlns:tns="www.example.org/people">

	<import namespace="commonj.sdo/xml" schemaLocation="sdoXML.xsd" />

	<complexType name="Person">
		<sequence>
			<element name="dob" type="date"/>
			<element name="relative" maxOccurs="unbounded" type="tns:Relative"/>
			<any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="id" type="ID"/>
		<attribute name="name" type="string"/>
	    <attribute name="gender" type = "tns:Gender"/>
	</complexType>

	<complexType name="Relative">
	    <attribute name="target" type="IDREF" sdoxml:propertyType="tns:Person" use="required"/>
	    <attribute name="relationship" type="string" />
	    <attribute name="genetic" use="optional" type="boolean"/>
	</complexType>

	<complexType name="PersonSet">
		<sequence>
			<element name="people" type="tns:Person" maxOccurs="unbounded"/>
		</sequence>
	</complexType>

	<simpleType name="Gender">
       <restriction base="string">
		   <enumeration value="male" />
		   <enumeration value="female" />
	   </restriction>
	</simpleType>

</schema>

Listing 2

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:people="www.example.org/people" xmlns:sdo="commonj.sdo"
	xmlns:sdoxml="commonj.sdo/xml"
	xmlns:tns="www.example.org/MedicalTest"
	targetNamespace="www.example.org/MedicalTest">

	<import namespace="www.example.org/people"
		schemaLocation="People.xsd" />

	<element name="test" type="tns:Test" />
	<element name="condition" type="tns:Condition" />

	<complexType name="Test">
		<sequence>
			<element name="referrals" type="people:PersonSet" />
			<element name="patients" type="people:PersonSet" />
			<element name="relatives" type="people:PersonSet" />
		</sequence>
	</complexType>

	<complexType name="Condition">
		<sequence>
			<element name="diagnosed" type="date" />
		</sequence>
		<attribute name="name" type="tns:ConditionName" />
	</complexType>

	<simpleType name="ConditionName">
		<restriction base="string">
			<enumeration value="Rigellian fever" />
			<enumeration value="Vegan choriomeningitis" />
			<enumeration value="Scrofungulus" />
			<enumeration value="Panarr Syndrome" />
		</restriction>
	</simpleType>

</schema>