<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
				xmlns:doc="http://rets.org/xsd/Documents/2007-08" 
				xmlns:commons="http://rets.org/xsd/RETSCommons/2007-08" 
				targetNamespace="http://rets.org/xsd/Documents/2007-08" 
				elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!--
		(C)2007 National Association of REALTORS(R)

		Tab stops
		:set ts=3

		File History
		======================
		$Header: Documents.xsd, 25, 10/8/2007 1:22:12 PM, Paul Stusiak$
		

		$Log:
		 25   055_RETS_Standard 1.24        10/8/2007 1:22:12 PM   Paul Stusiak
		      Update version timestamp
		 24   055_RETS_Standard 1.23        7/26/2007 9:06:15 PM   Paul Stusiak
		      update version timestamp
		 23   055_RETS_Standard 1.22        7/24/2007 10:43:58 PM  Paul Stusiak
		      use boundedCardinalInteger to avoid code generation use of BigDecimal;
		       replace RoleContactablePerson with ContactablePerson
		 22   055_RETS_Standard 1.21        7/10/2007 1:40:49 PM   Gina Accawi
		      Formatting.
		 21   055_RETS_Standard 1.20        7/9/2007 12:37:05 PM   Paul Stusiak
		      Update versionTimestamp to 2007-07-09T19:21:00Z
		 20   055_RETS_Standard 1.19        7/5/2007 5:58:15 PM    Paul Stusiak
		      use pattern of xs:nonNegativeInteger for elements or types with a name
		       <Property.Total> and a data type of decimal or integer
		 19   055_RETS_Standard 1.18        6/28/2007 10:55:56 AM  Gina Accawi
		      Add Unknown to document type enumerations.
		 18   055_RETS_Standard 1.17        6/27/2007 9:45:51 AM   Gina Accawi
		      Rename totalDocuments to documentsTotal for consistency with other
		      total naming convention.
		 17   055_RETS_Standard 1.16        5/10/2007 3:08:03 PM   Gina Accawi
		      Modify to use the RoleContactablePerson.
		 16   055_RETS_Standard 1.15        5/10/2007 9:40:50 AM   Gina Accawi
		      Make Originator required (as is required in transactions schema).
		      Rename documentLocation element to DocumentLocation for case
		      consistency. Reorder child elements of Document to map more closely to
		       transactions schema.
		 15   055_RETS_Standard 1.14        5/1/2007 2:12:21 PM    Paul Stusiak
		      Update the version timestamp, make the schema relative again,
		      normalize the date related typing to use SecureDateTime and naming to
		      be of the form XXXDateTime
		 14   055_RETS_Standard 1.13        4/3/2007 4:59:29 PM    Paul Stusiak
		      use url resolution for include, import to test schema validation
		 13   055_RETS_Standard 1.12        4/3/2007 1:43:56 AM    Paul Stusiak
		      change namespace to remote location (www.ftc2.com) for testing
		 12   055_RETS_Standard 1.11        4/2/2007 11:26:54 AM   Paul Stusiak
		      change namespace to match responding server and to use the URI
		      versioning suggested by both HP and XFront
		 11   055_RETS_Standard 1.10        3/30/2007 6:20:28 PM   Paul Stusiak
		      Update of the versionTimestamp and the namespace (namespace to
		      200704). Change formating to a standard format
		 10   055_RETS_Standard 1.9         3/8/2007 4:43:34 PM    Paul Stusiak
		      Fix standard header for documentation purposes, change document
		      formatting, add documentation stubs.
		 9    055_RETS_Standard 1.8         3/8/2007 11:57:59 AM   Gina Accawi
		      Rename documentID to documentId. Change type on Description to
		      SecureString. Change type on Size to SecureInteger.
		 8    055_RETS_Standard 1.7         2/28/2007 12:45:02 AM  Paul Stusiak
		      add standard header and refactoring RETSCommons changes
		 7    055_RETS_Standard 1.6         2/22/2007 3:34:46 PM   Gina Accawi
		      Remove all references to the schemaLocation as being
		      http://retsserver.realtors.org:8080/xsd/.  These references have been
		      changed to be relative path (as the current directory). Now,
		      regardless of where they are published, the referential internal
		      integrity will remain. The assumption is that these will all reside as
		       neighbors on the target distribution server.
		 6    055_RETS_Standard 1.5         12/20/2006 12:31:05 PM Jeff Brush
		      added retsserver location back to imports;  renamed Prospect to
		      SavedQuery; changed ListingHistory to track only select fields
		      identified by workgroup;renamed Agency to Agents and fixed references
		      in other schemas;changed TotalSqFeet references to TotalArea; per 12/7
		       MLS payload workgroup meeting
		 5    055_RETS_Standard 1.4         12/2/2006 1:12:44 AM   Paul Stusiak
		      various mechanical fixes tho the schema and a re-direct from
		      retsserver.realtors.org to www.ftc2.com
		 4    055_RETS_Standard 1.3         9/20/2006 12:43:25 PM  Jeff Brush
		      chgd schemaLocation to point to http://retsserver.rets.org:8080/xsd/
		 3    055_RETS_Standard 1.2         4/7/2006 7:36:38 PM    Jeff Brush
		      renamed version attribute to versionTimestamp for schema versioning
		 2    055_RETS_Standard 1.1         4/7/2006 1:37:27 PM    Jeff Brush
		      modified to have schema versioning as datetime, add year month to
		      namespaces, minor corrections
		 1    055_RETS_Standard 1.0         4/4/2006 8:06:06 AM    Jeff Brush
		      Updated schemas.  All MLS schemas have extensibility points.  New
		      ObjectReferenceList.xsd
		$
		======================
	-->
	<xs:annotation>
		<xs:documentation>
			Elements related to a Documents used in a Transaction.
		</xs:documentation>
	</xs:annotation>

	<xs:import	namespace="http://rets.org/xsd/RETSCommons/2007-08"
					schemaLocation="../../../xsd/RETSCommons/2007-08/RETSCommons.xsd"/>

	<!-- Attributes -->
	<xs:attribute name="documentType">
		<xs:annotation>
			<xs:documentation>
				TODO
			</xs:documentation>
		</xs:annotation>
		<xs:simpleType>
			<xs:restriction base="xs:token">
				<xs:enumeration value="PropertyDescription"/>
				<xs:enumeration value="ClosingStatement"/>
				<xs:enumeration value="MortgageLoanApplication"/>
				<xs:enumeration value="InsuranceApplication"/>
				<xs:enumeration value="TitleInsuranceRequest"/>
				<xs:enumeration value="PromissoryNote"/>
				<xs:enumeration value="TitleWarranty"/>
				<xs:enumeration value="MortgageLoan"/>
				<xs:enumeration value="InsurancePolicy"/>
				<xs:enumeration value="HomeWarranty"/>
				<xs:enumeration value="Offer"/>
				<xs:enumeration value="Binder"/>
				<xs:enumeration value="CounterOffer"/>
				<xs:enumeration value="Addendum"/>
				<xs:enumeration value="Contingency"/>
				<xs:enumeration value="ListingAgreement"/>
				<xs:enumeration value="EscrowAgreement"/>
				<xs:enumeration value="SellerAgencyAgreement"/>
				<xs:enumeration value="BuyerAgencyAgreement"/>
				<xs:enumeration value="PayoffStatement"/>
				<xs:enumeration value="Deed"/>
				<xs:enumeration value="Disclosure"/>
				<xs:enumeration value="TitleRecords"/>
				<xs:enumeration value="TitleEvidence"/>
				<xs:enumeration value="AbstractOfTitle"/>
				<xs:enumeration value="CreditFile"/>
				<xs:enumeration value="SellersNetSheet"/>
				<xs:enumeration value="SurveyReport"/>
				<xs:enumeration value="InspectionReport"/>
				<xs:enumeration value="UniformAppraisalReport"/>
				<xs:enumeration value="TaxDocument"/>
				<xs:enumeration value="CMA"/>
				<xs:enumeration value="Unknown"/>
				<xs:enumeration value="Other"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
	<!-- Types -->
	<xs:complexType name="Recipients">
		<xs:annotation>
			<xs:documentation>
				TODO
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Recipient"
				type="commons:ContactablePerson" minOccurs="0"
				maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Signers">
		<xs:annotation>
			<xs:documentation>
				TODO
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element	name="Signer"
							type="commons:ContactablePerson"
							minOccurs="0"
							maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Document">
		<xs:annotation>
			<xs:documentation>
				TODO
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element	name="Description"
							type="commons:SecureString"
							minOccurs="0"/>
			<xs:element	name="Size"
							type="commons:SecureInteger"
							minOccurs="0"/>
			<xs:element	name="CreatedDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="SentDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="ReceivedDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="DueDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="RespondedDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="SignedDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="UploadedRevisedDateTime"
							type="commons:SecureDateTime"
							minOccurs="0"/>
			<xs:element	name="Recipients"
							type="doc:Recipients"
							minOccurs="0"/>
			<xs:element	name="Signers"
							type="doc:Signers"
							minOccurs="0"/>
			<xs:element	name="Originator"
							type="commons:ContactablePerson"/>
			<xs:element	name="SentBy"
							type="commons:ContactablePerson"
							minOccurs="0"/>
			<xs:element	name="UploadedBy"
							type="commons:ContactablePerson"
							minOccurs="0"/>
			<xs:element	name="DocumentLocation"
							type="commons:URL"
							minOccurs="0"/>
			<xs:any		namespace="##other"
							minOccurs="0"
							maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute	name="documentId"
							type="xs:string"
							use="required"/>
		<xs:attribute	name="title"
							type="xs:string"
							use="required"/>
		<xs:attribute	name="status"
							type="xs:string"
							use="required"/>
		<xs:attribute	name="signable"
							type="xs:boolean"
							use="required"/>
		<xs:attribute	ref="doc:documentType"
							use="optional"/>
	</xs:complexType>
	<!-- Elements -->
	<xs:element name="Documents">
		<xs:annotation>
			<xs:documentation>
				TODO
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element	name="Document"
								type="doc:Document"
								minOccurs="0"
								maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute	name="documentsTotal"
								type="commons:boundedCardinalInteger"
								use="required"/>
			<xs:attribute	name="versionTimestamp"
								type="xs:dateTime"
								use="required"
								fixed="2007-10-08T16:27:23Z"/>
		</xs:complexType>
	</xs:element>
</xs:schema>