<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <xsd:complexType name = "classType">
      <xsd:all>
          <xsd:element name = "code" type = "xsd:string" />
          <xsd:element name = "numStudents" type = "xsd:integer" />
      </xsd:all>
      <xsd:attribute name ="id" type = "xsd:integer" />
  </xsd:complexType>

  <xsd:element name = "classes">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name = "class" type = "classType" maxOccurs = "unbounded" />
        </xsd:sequence>
    </xsd:complexType>
    <xsd:key name = "idCode">
        <xsd:selector xpath =  ".//class" />
        <xsd:field xpath =  "code" />
    </xsd:key>
  </xsd:element>

</xsd:schema>
