<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://testspace"
            elementFormDefault="qualified"
            version="1.0">


   <xs:complexType name="Root">
     <xs:sequence>
       <xs:element name="node" type="AbstractNode" minOccurs="1" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>

   <xs:complexType name="AbstractNode" abstract="true">
     <xs:attribute name="id" type="xs:int" />
   </xs:complexType>

   <xs:element name="NodeA">
     <xs:complexType>
     <xs:complexContent>
       <xs:extension base="AbstractNode">
         <xs:attribute name="typeAAttrib" type="xs:string" />
       </xs:extension>
     </xs:complexContent>
     </xs:complexType>
    </xs:element>

   <xs:element name="NodeB">
     <xs:complexType>
     <xs:complexContent>
       <xs:extension base="AbstractNode">
         <xs:attribute name="typeBAttrib" type="xs:string" />
       </xs:extension>
     </xs:complexContent>
     </xs:complexType>
   </xs:element>

</xs:schema>
