<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:common="http://example.com/common"
           xmlns:lib="http://example.com/library"
           targetNamespace="http://example.com/library"
           elementFormDefault="qualified">

  <!-- Cross-namespace import: resolved against common-types.xsd in the set. -->
  <xs:import namespace="http://example.com/common" schemaLocation="common-types.xsd"/>
  <!-- Same-namespace include: resolved against library-elements.xsd in the set. -->
  <xs:include schemaLocation="library-elements.xsd"/>

  <xs:complexType name="Book">
    <xs:annotation>
      <xs:documentation>A catalogued book with shipping details.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="title" type="xs:string"/>
      <xs:element name="author" type="xs:string"/>
      <xs:element name="publisher" type="lib:Publisher" minOccurs="0"/>
      <xs:element name="shippingAddress" type="common:Address" minOccurs="0"/>
      <xs:element name="country" type="common:CountryCode" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="isbn" type="xs:string" use="required"/>
  </xs:complexType>

  <xs:element name="GetBookRequest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="isbn" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="GetBookResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="book" type="lib:Book"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
