<?xml version="1.0"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name="nlong">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:long" />
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:length value="0" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="RNN">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:length value="12" />
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:length value="0" />
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="IINBIN">
    <xs:restriction base="xs:string">
      <xs:pattern value="[0-9]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="guid">
    <xs:annotation>
      <xs:documentation xml:lang="en">
        The representation of a GUID, generally the id of an element.
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="Root">
    <xs:complexType>
      <xs:all>
        <xs:element name="OrganisationData">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="0" name="SystemId" type="nlong" />
              <xs:element minOccurs="0" name="CfmCode">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:long">
                      <xs:attribute name="AT" type="xs:long" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="OpfCode">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="nlong">
                      <xs:attribute name="AT" type="xs:long" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" name="OrgName" />
              <xs:element minOccurs="0" name="ShortName" />
              <xs:element minOccurs="0" name="RNN" type="RNN" />
              <xs:element minOccurs="0" name="IINBIN" type="IINBIN" />
              <xs:element name="BIK" />
              <xs:element name="OKED" />
              <xs:element name="RegisterDate" />
              <xs:element name="RegisterNumber" />
              <xs:element name="RegisterAgency" />
              <xs:element name="AdditionalAcData" nillable="true">
                <xs:complexType>
                  <xs:all>
                    <xs:element name="FirstName" />
                    <xs:element name="SecondName" />
                    <xs:element name="MiddleName" />
                    <xs:element name="DocumentIdentity" />
                    <xs:element minOccurs="0" name="SeriesDocIdentity" />
                    <xs:element name="NumberDocIdentity" />
                    <xs:element name="DocumentIssued" />
                    <xs:element name="DateIssuance" />
                  </xs:all>
                  <xs:attribute name="IsAc" />
                </xs:complexType>
              </xs:element>
              <xs:element name="PostalIndex" />
              <xs:element name="Area">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="AT" type="xs:long" />
                      <xs:attribute name="Code" type="nlong" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="District">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="AT" type="xs:long" />
                      <xs:attribute name="Code" type="nlong" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="City">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="AT" type="xs:long" />
                      <xs:attribute name="Code" type="nlong" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="Street" />
              <xs:element name="House" />
              <xs:element name="Office" />
              <xs:element name="Persons">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="Person">
                      <xs:complexType>
                        <xs:all>
                          <xs:element name="FirstName" />
                          <xs:element name="SecondName" />
                          <xs:element name="MiddleName" />
                          <xs:element name="IndividualNumber" />
                          <xs:element name="JobName" />
                          <xs:element name="Phone" />
                          <xs:element name="Email" />
                          <xs:element name="Certificate">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="Name" />
                                  <xs:attribute name="Size" type="xs:long" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:all>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Founders">
                <xs:complexType>
                  <xs:sequence minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="Founder">
                      <xs:complexType>
                        <xs:all>
                          <xs:element name="FounderType">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="AT" type="xs:long" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="OpfCode" />
                          <xs:element name="UrName" />
                          <xs:element name="AdditionalAcData">
                            <xs:complexType>
                              <xs:all>
                                <xs:element name="FirstName" />
                                <xs:element name="SecondName" />
                                <xs:element name="MiddleName" />
                                <xs:element name="DocumentIdentity" />
                                <xs:element name="SeriesDocIdentity" />
                                <xs:element name="NumberDocIdentity" />
                                <xs:element name="DocumentIssued" />
                                <xs:element name="DateIssuance" />
                              </xs:all>
                              <xs:attribute name="IsAc" />
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="ResidenceCode">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="xs:string">
                                  <xs:attribute name="AT" type="xs:long" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:all>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:all>
          </xs:complexType>
        </xs:element>
        <xs:element name="Version" type="guid" />
        <xs:element name="DocumentUniqueIdentifier" type="guid" />
      </xs:all>
    </xs:complexType>
  </xs:element>
</xs:schema>