<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://x.x.x" xmlns="http://x.x.x" xmlns:xxx="http://x.x.x" elementFormDefault="qualified">
    <xsd:element name="root">
        <xsd:complexType>
            <xsd:all>
			    <xsd:element name="superset">
			        <xsd:complexType>
			            <xsd:all>
			                <xsd:element name="subset1">
			                    <xsd:complexType>
			                        <xsd:sequence>
			                            <xsd:element name="s1elements">
			                                <xsd:complexType>
			                                    <xsd:sequence>
			                                        <xsd:element name="s1element" minOccurs="0" maxOccurs="unbounded">
			                                            <xsd:complexType>
			                                                <xsd:attribute name="att1"/>
			                                                <xsd:attribute name="att2"/>
			                                                <xsd:attribute name="name"/>
			                                            </xsd:complexType>
			                                        </xsd:element>
			                                    </xsd:sequence>
			                                </xsd:complexType>
			                            </xsd:element>
			                        </xsd:sequence>
			                    </xsd:complexType>
			                    <xsd:key name="key_s1element">
			                        <xsd:selector xpath="xxx:s1elements/xxx:s1element"/>
			                        <xsd:field xpath="@att1"/>
			                        <xsd:field xpath="@att2"/>
			                    </xsd:key>
			                </xsd:element>
			                <xsd:element name="subset2">
			                    <xsd:complexType>
			                        <xsd:sequence>
			                            <xsd:element name="s2elements">
			                                <xsd:complexType>
			                                    <xsd:sequence>
			                                        <xsd:element name="s2element" minOccurs="0" maxOccurs="unbounded">
			                                            <xsd:complexType>
			                                                <xsd:attribute name="att1"/>
			                                                <xsd:attribute name="att2"/>
			                                                <xsd:attribute name="name"/>
			                                            </xsd:complexType>
			                                        </xsd:element>
			                                    </xsd:sequence>
			                                </xsd:complexType>
			                            </xsd:element>
			                        </xsd:sequence>
			                    </xsd:complexType>
			                    <xsd:key name="key_s2element">
			                        <xsd:selector xpath="xxx:s2elements/xxx:s2element"/>
			                        <xsd:field xpath="@att1"/>
			                        <xsd:field xpath="@att2"/>
			                    </xsd:key>
			                </xsd:element>
			            </xsd:all>
			        </xsd:complexType>
			        <xsd:keyref name="keyref_s2element_s1element" refer="xxx:key_s1element">
			            <xsd:selector xpath="xxx:subset2/xxx:s2elements/xxx:s2element"/>
			            <xsd:field xpath="@att1"/>
			            <xsd:field xpath="@att2"/>
			        </xsd:keyref>
			    </xsd:element>
			</xsd:all>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>