<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:complexType name="BODYType">
    <xs:sequence>
      <xs:element name="CONFIGURATION" type="CONFIGURATIONType"/>
      <xs:element name="STATUS" type="STATUSType"/>
      <xs:element ref="SECURITY_PARAMETERS"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="CONFIGURATIONType">
    <xs:all>
      <xs:element ref="METADATA_FORMAT"/>
      <xs:element ref="METADATA_FORMAT_INTERPRETATION"/>
      <xs:element ref="METADATA_FORMAT_LAYOUT"/>
    </xs:all>
  </xs:complexType>
  <xs:complexType name="DATE_OF_CREATIONType">
    <xs:attribute name="value" type="xs:dateTime" use="required"/>
  </xs:complexType>
  <xs:complexType name="HEADERType">
    <xs:all>
      <xs:element name="RESOURCE_IDENTIFIER" type="RESOURCE_IDENTIFIERType"/>
      <xs:element name="RESOURCE_TYPE" type="RESOURCE_TYPEType"/>
      <xs:element name="RESOURCE_KIND" type="RESOURCE_KINDType"/>
      <xs:element name="RESOURCE_URI" type="RESOURCE_URIType"/>
      <xs:element name="DATE_OF_CREATION" type="DATE_OF_CREATIONType"/>
    </xs:all>
  </xs:complexType>
  <xs:complexType name="RESOURCE_IDENTIFIERType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="RESOURCE_KINDType">
    <xs:attribute name="value" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="MDStoreDSResources"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:element name="RESOURCE_PROFILE">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="HEADER" type="HEADERType"/>
        <xs:element name="BODY" type="BODYType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="RESOURCE_TYPEType">
    <xs:attribute name="value" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="MDStoreDSResourceType"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
  <xs:complexType name="RESOURCE_URIType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:element name="SECURITY_PARAMETERS" type="xs:string"/>
  <xs:complexType name="STATUSType">
    <xs:all>
      <xs:element ref="PENULTIMATE_STORAGE_DATE"/>
      <xs:element ref="LAST_STORAGE_DATE"/>
      <xs:element name="FETCHING_FREQUENCY"/>
      <xs:element ref="NUMBER_OF_RECORDS"/>
      <xs:element name="STATISTICS_FIELDS" type="STATISTICS_FIELDSType"/>
    </xs:all>
  </xs:complexType>
  <xs:element name="METADATA_FORMAT" type="xs:string"/>
  <xs:element name="METADATA_FORMAT_INTERPRETATION" type="xs:string"/>
  <xs:element name="METADATA_FORMAT_LAYOUT" type="xs:string"/>
  <xs:element name="PENULTIMATE_STORAGE_DATE" type="xs:string"/>
  <xs:element name="LAST_STORAGE_DATE" type="xs:string"/>
  <xs:element name="FETCHING_FREQUENCY" type="xs:string"/>
  <xs:complexType name="VFIELDType">
    <xs:sequence>
      <xs:element name="VALUE" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:complexType name="FIELDType">
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>
  <xs:element name="NUMBER_OF_RECORDS" type="xs:int"/>
  <xs:complexType name="STATISTICS_FIELDSType">
    <xs:sequence>
      <xs:element name="FIELD" type="VFIELDType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>
