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

Copyright (c) SDMX 2005
All rights reserved.
http://www.sdmx.org



-->

<xs:schema targetNamespace="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/registry" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/registry" xmlns:common="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common" xmlns:structure="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/structure" >
	<xs:import namespace="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/common" schemaLocation="SDMXCommon.xsd"/>
	<xs:import namespace="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/structure" schemaLocation="SDMXStructure.xsd"/>
	
	<xs:complexType name="SubmitSubscriptionRequestType">	
		<xs:annotation>
			<xs:documentation>The SubmitSubscriptionRequest element is submitted to the registry to subscribe to registration and change events for specific registry resources.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Subscription" type="SubscriptionType" maxOccurs="unbounded"/>		
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="SubmitSubscriptionResponseType">
		<xs:annotation>
			<xs:documentation>The SubmitSubscriptionResponse element contains information which describes the success or failure of a Subscription, providing any error messages in the event of failure. It also returns the registry URN of the subscription, and the subscriber-assigned ID.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="SubscriptionURN" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="SubscriberAssignedID" type="common:IDType" minOccurs="0"/>
			<xs:element name="SubscriptionStatus" type="StatusMessageType" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="NotifyRegistryEventType">
		<xs:annotation>
			<xs:documentation>The NotifyRegistryEvent element is sent by the registry services to subscribers, to notify them of specific registration and change events. EventTime specifies the time of the triggering event. ObjectURN provides the URN of the object on which the event occurred. SubscriptionURN provides the registry/repository URN of the subscription. EventAction indicates the nature of the event - whether the action was an addition, a modification, or a deletion.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="EventTime" type="xs:dateTime"/>
			<xs:element name="ObjectURN" type="xs:anyURI"/>
			<xs:element name="SubscriptionURN" type="xs:anyURI"/>
			<xs:element name="EventAction" type="common:ActionType"/>
			<xs:choice>
				<xs:element name="StructuralEvent" type="StructuralEventType"/>
				<xs:element name="ProvisioningEvent" type="ProvisioningEventType"/>
				<xs:element name="RegistrationEvent" type="RegistrationEventType"/>				
			</xs:choice>
			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="SubmitRegistrationRequestType">
		<xs:annotation>
			<xs:documentation>SubmitRegistrationRequest is sent to the registry by an agency or data/metadata provider to request registration for a data set or metadata set. The resource to be registered must be accessible to the registry services at an indicated URL, so that it can be processed by those services. This is the datasource, which may also have been specified for the data provider or provision agreement, in which case it need not appear here. Constraints describing the content and release calendar of the registered dataset (and, for metadata sets, the release calendar) may also be included.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Registration" type="RegistrationType" maxOccurs="unbounded"/>					
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="SubmitRegistrationResponseType">
		<xs:annotation>
			<xs:documentation>This document is sent to the agency or data/metadata provider in response to a registration request. It indicates the success or failure of the registration request, and contains any error messages generated by the registration service.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="RegistrationStatus" type="RegistrationStatusType" maxOccurs="unbounded"/>					
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QueryRegistrationRequestType">
		<xs:annotation>
			<xs:documentation>The QueryRegistrationRequest is used to query the contents of a registry for data sets and metadata sets. The QueryRegistrationRequest specifies whether the result set should include metadata sets, data sets, or both with the QueryType element. The constraints which characterize the search - including reference period, are contained in teh Constraints within the child object references.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="QueryType" type="QueryTypeType"/>
			<xs:choice>
			<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType"/>
			<xs:element name="DataflowRef" type="DataflowRefType"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType"/>
			<xs:element name="DataProviderRef" type="DataProviderRefType"/>
			</xs:choice>
			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QueryRegistrationResponseType">
		<xs:annotation>
			<xs:documentation>The QueryRegistrationResponse is sent as a response document to anyone querying the contents of a registry. The results set contains a set of links to data and/or metadata If the result set is null, or there is some other problem with the query, then appropriate error messages and statuses will be returned.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="QueryResult" type="QueryResultType" maxOccurs="unbounded"/>		
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="SubmitStructureRequestType">
		<xs:annotation>
			<xs:documentation>SubmitStructureRequest is used to submit structure definitions - key families, metadata structures - to the repository. The structure resources (key families, agencies, concepts and concept schemes, codelists,etc.) to be submitted must be available as valid SDMX-ML Structure messages external to the registry, so that they can be retrieved by the repository submission service. A SubmitStructureResponse will be sent in response, and will indicate status and contain anyt relevant error information. StructureLocation holds the URL of the valid Structure Message. Alternately, the Structure element can contain the structural descriptions. The SubmittedStructureType contains a reference to one of the structural maintainable artefacts detailed in the Structure Message, which is to be submitted to the repository. It does not need to be used when the structures being submitted are included in the request message, or when all objects in the referenced SDMX-ML Structure message are to submitted.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:choice>
				<xs:element name="StructureLocation" type="xs:anyURI"/>
				<xs:element name="Structure" type="StructureType"/>
			</xs:choice>
			<xs:element name="SubmittedStructure" type="SubmittedStructureType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="SubmitStructureResponseType">
		<xs:annotation>
			<xs:documentation>SubmitStructureResponse is returned by the registry when a SubmitStructure is received. It indicates the status of the submission, and carries any error messages which are generated, if relevant. For each submitted structure, a SubmissionResult will be returned.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="SubmissionResult" type="SubmissionResultType" maxOccurs="unbounded"/>		
		</xs:sequence>
	</xs:complexType>	
	
	<xs:complexType name="QueryStructureRequestType">
		<xs:annotation>
			<xs:documentation>QueryStructureRequest is used to query the registry for any maintainable object within the repository. The response is a Structure message. In the reference elements to the queryable registry objects, a valid registry URN or a complete set of other child elements may be used to identify the objects desired in the result set. Any part of an element-based (that is, non-URN) identification of an object which is not provided will be understood as a wild-card value, referring to "all" possible values. The resolveReferences attribute is set to true if all dependent objects should also be returned as part of the result set. (For example, if you query for a key family and want to also have all codelists, concepts, and agencies, returned as well, resolveReferences should be set to true.)</xs:documentation>			
		</xs:annotation>
		<xs:choice maxOccurs="unbounded">
			<xs:element name="AgencyRef" type="AgencyRefType"/>
			<xs:element name="DataProviderRef" type="DataProviderRefType"/>			
			<xs:element name="DataflowRef" type="DataflowRefType"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType"/>			
			<xs:element name="CodelistRef" type="CodelistRefType"/>
			<xs:element name="CategorySchemeRef" type="CategorySchemeRefType"/>
			<xs:element name="ConceptSchemeRef" type="ConceptSchemeRefType"/>
			<xs:element name="OrganisationSchemeRef" type="OrganisationSchemeRefType"/>
			<xs:element name="KeyFamilyRef" type="KeyFamilyRefType"/>
			<xs:element name="MetadataStructureRef" type="MetadataStructureRefType"/>
			<xs:element name="HierarchicalCodelistRef" type="HierarchicalCodelistRefType"/>
			<xs:element name="StructureSetRef" type="StructureSetRefType"/>
			<xs:element name="ProcessRef" type="ProcessRefType"/>			
			<xs:element name="ReportingTaxonomyRef" type="ReportingTaxonomyRefType"/>			
			
		</xs:choice>
		<xs:attribute name="resolveReferences" type="xs:boolean" use="required"/>
	</xs:complexType>
	
	<xs:complexType name="QueryStructureResponseType">
		<xs:annotation>
			<xs:documentation>QueryStructureResponse is sent in response to a QueryStructureRequest. It carries the status of the response, with any relevant error messages, and then also carries all information found in the rersult set.</xs:documentation>			
		</xs:annotation>
		<xs:sequence>
			<xs:element name="StatusMessage" type="StatusMessageType"/>		
			<xs:element name="OrganisationSchemes" type="structure:OrganisationSchemesType" minOccurs="0"/>
			<xs:element name="Dataflows" type="structure:DataflowsType" minOccurs="0"/>
			<xs:element name="Metadataflows" type="structure:MetadataflowsType" minOccurs="0"/>
			<xs:element name="CategorySchemes" type="structure:CategorySchemesType" minOccurs="0"/>					
			<xs:element name="CodeLists" type="structure:CodeListsType" minOccurs="0"/>
			<xs:element name="HierarchicalCodelists" type="structure:HierarchicalCodelistsType" minOccurs="0"/>
			<xs:element name="Concepts" type="structure:ConceptsType" minOccurs="0"/>
			<xs:element name="MetadataStructureDefinitions" type="structure:MetadataStructureDefinitionsType" minOccurs="0"/>
			<xs:element name="KeyFamilies" type="structure:KeyFamiliesType" minOccurs="0"/>
			<xs:element name="StructureSets" type="structure:StructureSetsType" minOccurs="0"/>
			<xs:element name="ReportingTaxonomies" type="structure:ReportingTaxonomiesType" minOccurs="0"/>					
			<xs:element name="Processes" type="structure:ProcessesType" minOccurs="0"/>
		</xs:sequence>
	
	
	</xs:complexType>
	
	<xs:complexType name="SubmitProvisioningRequestType">
		<xs:annotation>
			<xs:documentation>This document is sent to the registry services to submit provisioning information. A provision agreement is typically sent, wghich has internal references to existing data rpvodiers and dataflows/metadataflows. These elements are also included as possible separate submissions, because it may be necessary to provide datasource and constraint information independent of the establishment of a provision agreement. </xs:documentation>
		</xs:annotation>
		<xs:choice maxOccurs="unbounded">
			<xs:element name="ProvisionAgreement" type="ProvisionAgreementType"/>
			<xs:element name="DataProviderRef" type="DataProviderRefType"/>
			<xs:element name="DataflowRef" type="DataflowRefType" />
			<xs:element name="MetadatataflowRef" type="MetadataflowRefType" />				
		</xs:choice>
	</xs:complexType>
	
	<xs:complexType name="SubmitProvisioningResponseType">
		<xs:annotation>
			<xs:documentation>The ProvisioningResponse element is returned by the registry services in response to a provisioning request. It contains information about the status of the submitted provisioning information, and any relevant error messages in case of failure.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ProvisioningStatus" type="ProvisioningStatusType" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QueryProvisioningRequestType">
		<xs:annotation>
			<xs:documentation>QueryProvisioningRequest is used to query the repository for provisioning metadata. The response is a QueryProvisioningResponse document, carrying either the result set of the query or relevant error messages. Note that whatever information is presented here, regarding provision agreements, data flow, metadataflow, or data providers, is taken to be the search criteria - the query is for all provision agreements which match the supplied criteria. If any of provision agreement, metadataflow, dataflow, or data provider are omitted, the search will apply to all values for those objects in the repository.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType" minOccurs="0"/>
			<xs:element name="DataflowRef" type="DataflowRefType" minOccurs="0"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType" minOccurs="0"/>			
			<xs:element name="DataProviderRef" type="DataProviderRefType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QueryProvisioningResponseType">
		<xs:annotation>
			<xs:documentation>The QueryProvisioningResponse element is returned in response to queries regarding provisioning information. It carries either the provisioning information making up the result set, or relevant status messages containing errors or warnings, or both. The references to Dataflow, Metadataflow, and Data Provider are included in those cases where the  result set has these objects, but not associated with any Provisioning Agreement.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ProvisionAgreement" type="ProvisionAgreementType" maxOccurs="unbounded" minOccurs="0"/>
			<xs:element name="DataflowRef" type="DataflowRefType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType" minOccurs="0" maxOccurs="unbounded"/>			
			<xs:element name="DataProviderRef" type="DataProviderRefType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="StatusMessage" type="StatusMessageType"/>
		</xs:sequence>
	</xs:complexType>
	
<!-- Subscription/Notification Types -->


	<xs:complexType name="SubscriptionType">
		<xs:annotation><xs:documentation>Subscriptions submit a subscription for a registry or repository object.Action indicates what action is being taken by sending the request. RegistryURN is used to identify the subscription in the case of deletion or modification. NotificationMAilTo holds an e-mail address (the "mailto:" protocol); NotificationHTTP holds an http address to which notifications can be addressed as POSTs. SubscriberAssignedID allows the subscriber to specify an ID which will be returned as part of the notification for the subscribed events. Validity period sets a start and end date for the subscription, EventSelector indicates an event or events for the subscription.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="Action" type="common:ActionType" />
			<xs:element name="RegistryURN" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="NotificationMailTo" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="NotificationHTTP" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="SubscriberAssignedID" type="common:IDType" minOccurs="0"/>
			<xs:element name="ValidityPeriod" type="ValidityPeriodType"/>
			<xs:element name="EventSelector" type="EventSelectorType" />
		</xs:sequence>
	</xs:complexType>
	
	
	<xs:complexType name="ValidityPeriodType">
		<xs:annotation><xs:documentation>Specifies inclusive start and end-dates for the subscription period.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="StartDate" type="xs:date"/>
			<xs:element name="EndDate" type="xs:date"/>			
		</xs:sequence>
	</xs:complexType>
	
	
	<xs:complexType name="EventSelectorType">
		<xs:annotation><xs:documentation>Allows subscribers to specify registry and repository events for which they wish to receive notifications.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="StructuralRepositoryEvents" type="StructuralRepositoryEventsType" minOccurs="0"/>
			<xs:element name="ProvisioningRepositoryEvents" type="ProvisioningRepositoryEventsType" minOccurs="0"/>
			<xs:element name="DataRegistrationEvents" type="DataRegistrationEventsType" minOccurs="0" />
			<xs:element name="MetadataRegistrationEvents" type="MetadataRegistrationEventsType" minOccurs="0" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="StructuralRepositoryEventsType">
		<xs:annotation><xs:documentation>Contains details of the subscribed structural repository events. AgencyID specifies an agency for the object or objects indicated in the other ID fields. Note that the ID fields (including AgencyID) may hold a complete ID or Repository URN, but may also insert the "%" wildcard character, which represents 0 or more characters, in the ID string. If left empty, all objects will be matched within the other constraints (agency, object type) provided.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="AgencyID" type="common:IDType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="AllEventsID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="KeyFamilyID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ConceptSchemeID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="CodeListID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadataStructureID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="CategorySchemeID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
			<xs:element name="OrganisationSchemeID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="HierarchicalCodelistID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="StructureSetID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ReportingTaxonomyID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="ProcessID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
			
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ProvisioningRepositoryEventsType">
		<xs:annotation><xs:documentation>Contains details of the subscribed provisioning repository events. Note that the ID fields may hold a complete ID or Repository URN, but may also insert the "%" wildcard character, which represents 0 or more characters, in the ID string. If left empty, all objects will be matched within the other constraints (agency, object type) provided.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="ProvisionAgreementID" type="common:IDType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataProviderID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="AllEventsID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="DataRegistrationEventsType">
		<xs:annotation><xs:documentation>Contains details of the subscribed data registry events. Note that the ID fields may hold a complete ID or Registry URN, but may also insert the "%" wildcard character, which represents 0 or more characters, in the ID string. If left empty, all objects will be matched within the other constraints (agency, object type) provided.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="AllEventsID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataProviderID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			<xs:element name="ProvisionAgreementID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="KeyFamilyID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="CategoryID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="CategorySchemeID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
			<xs:element name="CategorySchemeAgencyID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="MetadataRegistrationEventsType">
		<xs:annotation><xs:documentation>Contains details of the subscribed metadadata registry events. Note that the ID fields may hold a complete ID or Registry URN, but may also insert the "%" wildcard character, which represents 0 or more characters, in the ID string. If left empty, all objects will be matched within the other constraints (agency, object type) provided.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="AllEventsID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="DataProviderID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
			<xs:element name="ProvisionAgreementID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadataflowID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="MetadatastructureID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="CategoryID" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="StructuralEventType">
		<xs:annotation><xs:documentation>This provides the details of a structural repository event for the purposes of notification.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="OrganisationSchemes" type="structure:OrganisationSchemesType" minOccurs="0"/>
			<xs:element name="Dataflows" type="structure:DataflowsType" minOccurs="0"/>
			<xs:element name="Metadataflows" type="structure:MetadataflowsType" minOccurs="0"/>
			<xs:element name="CategorySchemes" type="structure:CategorySchemesType" minOccurs="0"/>					
			<xs:element name="CodeLists" type="structure:CodeListsType" minOccurs="0"/>
			<xs:element name="HierarchicalCodelists" type="structure:HierarchicalCodelistsType" minOccurs="0"/>
			<xs:element name="Concepts" type="structure:ConceptsType" minOccurs="0"/>
			<xs:element name="MetadataStructureDefinitions" type="structure:MetadataStructureDefinitionsType" minOccurs="0"/>
			<xs:element name="KeyFamilies" type="structure:KeyFamiliesType" minOccurs="0"/>
			<xs:element name="StructureSets" type="structure:StructureSetsType" minOccurs="0"/>
			<xs:element name="Processes" type="structure:ProcessesType" minOccurs="0"/>
			<xs:element name="ReportingTaxonomies" type="structure:ReportingTaxonomiesType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>
	

	<xs:complexType name="ProvisioningEventType">
		<xs:annotation><xs:documentation>This provides the details of a provisioning event for the purposes of notification.</xs:documentation></xs:annotation>
		<xs:sequence>
		
			<xs:element name="DataProviderRef" type="DataProviderRefType" minOccurs="0"/>
			<xs:element name="DataflowRef" type="DataflowRefType" minOccurs="0"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType" minOccurs="0"/>
			<xs:element name="ProvisionAgreement" type="ProvisionAgreementType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="RegistrationEventType">
		<xs:annotation><xs:documentation>This provides the details of a data or metadata registration event for the purposes of notification.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="Registration" type="RegistrationType" />
		</xs:sequence>
	</xs:complexType>
		

	
<!-- ProvisionRequest Types -->

	<xs:complexType name="ProvisionAgreementType">
	
	
		<xs:annotation>
			<xs:documentation>Provision agreements contain a reference to a pre-existing data flow or metadata flow definition and a pre-existing data (or metadata) provider in the registry. They also must have the action attribute set, indicating whether this is an addition, a modification, or a deletion of a provision agreement. They may also supply boolean values which describe how the registry must behave: if indexTimeSeries is true, then the registry must index all time series when a data set is registered against this provision agreement; if indexDataSet is true, then the registry must index the range of actual (present) values for each dimension of the Dataset (as indicated in the dataset's key family); if indexReportingPeriod is true, then the registry must index the time period ranges for which data are present in the dataset(s) registered against the provision agreement. Note that the values for these attributes are not needed when a Delete action is indicated. As for all identifiable objects, provision agreements have Name and Description elements, which are repeatable to provide language-specific forms. These may be ommitted if the provision agreement already exists (as is the case for modification and deletion); descriptions are always optional. The id attribute holds the unique id of the provision agreement as derived (according to teh logical registry specifcation.) If specified, the uri attribute points to a location (typically a URL) where the provision agreement is described in a valid QueryProvisioningResponse message. The urn attribute holds the reserved registry URN assigned to the provision agreement - this must be included when the ProvisionAgreement structure is used in a response document of any type. The action  attribute must be specified when the provisionAgreement is used in a request document of any type.. Datasource is used to describe the data source associated with the provider agreement. Annotations may be provided in the Annotations element. The validFrom and validTo attributes provide inclusive dates for providing supplemental validity information about the version.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Name" type="common:TextType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="Description" type="common:TextType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:choice>
			<xs:element name="DataflowRef" type="DataflowRefType"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType"/>	
			</xs:choice>
			<xs:element name="DataProviderRef" type="DataProviderRefType"/>
			<xs:element name="Datasource" type="QueryableDatasourceType" minOccurs="0"/>
			<xs:element name="Constraint" type="common:ConstraintType" minOccurs="0"/>
			<xs:element name="Annotations" type="common:AnnotationsType" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="id" type="common:IDType" use="optional"/>
		<xs:attribute name="uri" type="xs:anyURI" use="optional"/>
		<xs:attribute name="urn" type="xs:anyURI" use="optional"/>		
		<xs:attribute name="action" type="common:ActionType" use="optional"/>
		<xs:attribute name="indexTimeSeries" type="xs:boolean" use="optional"/>
		<xs:attribute name="indexDataSet" type="xs:boolean" use="optional"/>
		<xs:attribute name="indexReportingPeriod" type="xs:boolean" use="optional"/>
		<xs:attribute name="validFrom" type="common:TimePeriodType" use="optional"/>
		<xs:attribute name="validTo" type="common:TimePeriodType" use="optional"/>		
	</xs:complexType>
	<xs:complexType name="DatasourceType">
		<xs:annotation><xs:documentation>Datasource specifies the properties of a data or metadata source. A SimpleDatasource requires only the URL of the data. A QueryableDatasource must be able to accept an SDMX-ML Query Message, and respond appropriately. Either or both may be specified.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="SimpleDatasource" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="QueryableDatasource" type="QueryableDatasourceType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="QueryableDatasourceType">
		<xs:annotation><xs:documentation>If the data provider uses a single, queryable data source for all provision agreements contained in the ProvisionRequest element, then this element should be used to describe the queryable datasource. DataUrl contains the URL of the datasource, with WSDLUrl optionally providing the location of a WSDL instance on the internet which deascribes the queryable datasource. The attributes isRESTDatasource and isWebServiceDatasource indicate, if true, that the queryable datasource is accessible via the REST protocol and/or Web Services protocols, respectively.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="DataUrl" type="xs:anyURI" />
			<xs:element name="WSDLUrl" type="xs:anyURI"  minOccurs="0"/>			
		</xs:sequence>
		<xs:attribute name="isRESTDatasource" type="xs:boolean" use="required"/>
		<xs:attribute name="isWebServiceDatasource" type="xs:boolean" use="required"/>		
	</xs:complexType>
		
	<xs:complexType name="ProvisioningStatusType">
		<xs:annotation><xs:documentation>For each provision agreement, dataflow reference, metadataflow reference, or data provider reference submitted in a provisioning request, a provisioning status will be returned, providing a status and any warnings or errors.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:choice>
				<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType" />
				<xs:element name="DataProviderRef" type="DataProviderRefType" />
				<xs:element name="DataflowRef" type="DataflowRefType" />
				<xs:element name="MetadataflowRef" type="MetadataflowRefType" />
			</xs:choice>
			<xs:element name="StatusMessage" type="StatusMessageType" />
		</xs:sequence>
	</xs:complexType>
	
<!-- Registration Types -->	

	<xs:complexType name="RegistrationType">
		<xs:annotation><xs:documentation>Registration provides the information needed for data and reference metadata set registration. LastUpdated can provide a time stamp; ValidFrom and ValidTo allow for effectivity, so that data visibility from the registry can be controlled by the registrant. A Datasource must be supplied here if not already provided in the provision agreement. The data set or metadata set must be associated with a provision agreement,  a metadataflow, or a dataflow definition. If possible, the provision agreement should be specified. Only in cases where this is not possible should the dataflow or metadataflow be used.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="LastUpdated" type="xs:dateTime" minOccurs="0"/>
			<xs:element name="ValidFrom" type="xs:dateTime" minOccurs="0" />
			<xs:element name="ValidTo" type="xs:dateTime" minOccurs="0" />
			<xs:element name="Action" type="common:ActionType" />
			<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
			<xs:choice>
				<xs:element name="DataflowRef" type="DataflowRefType"/>
				<xs:element name="MetadataflowRef" type="MetadataflowRefType"/>	
				<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType" />
				
			</xs:choice>
			
			
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="RegistrationStatusType">
		<xs:annotation><xs:documentation>Each RegistrationStatus reports the status of a submitted data set or metadata set registration, and carries any error messages. If successful, the Datasource which has been registered is returned, and a reference to the provision agreement, dataflow, metadataflow, or data provider is returned.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="StatusMessage" type="StatusMessageType"/> 
			<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
			<xs:element name="DataProviderRef" type="DataProviderRefType" minOccurs="0"/>
			<xs:element name="DataflowRef" type="DataflowRefType" minOccurs="0"/>
			<xs:element name="MetadaflowRef" type="MetadataflowRefType" minOccurs="0"/>
			<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>	
	
<!-- Registry Query Types -->


	
<xs:complexType name="QueryResultType">
		<xs:annotation><xs:documentation>QueryResult contains the results of a specific registry query for a single datasource. If a successful result is a registered dataset, the DataResult element is used. If a successful result is a registered metadataset, the MetadataResult is used. If the query failed, then StatusMessage is included. The timeSeriesMatch attribute is true when the result is an exact match with the key found in the registry - that is, when the registered datasource provides a matching key. It is set to false when the datasource is registered with cube-region constraints, or in any other circumstance when it cannot be established that the sought-for keys have been exactly matched. This is always true when the resulting datasource is the source of a metadata set.</xs:documentation></xs:annotation>
		<xs:choice>
			<xs:element name="DataResult" type="ResultType"/>
			<xs:element name="MetadataResult" type="ResultType"/>
			<xs:element name="StatusMessage" type="StatusMessageType"/>
		</xs:choice>
		<xs:attribute name="timeSeriesMatch" type="xs:boolean" use="required"/>
	</xs:complexType>
	
	<xs:complexType name="ResultType">
		<xs:annotation><xs:documentation>Result contains the information about either a data or metadata source, being returned as part of a QueryResult element. If the </xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
			<xs:choice>
			<xs:element name="ProvisionAgreementRef" type="ProvisionAgreementRefType"/>
			<xs:element name="DataflowRef" type="DataflowRefType"/>
			<xs:element name="MetadataflowRef" type="DataflowRefType"/>
			<xs:element name="DataProviderRef" type="DataProviderRefType"/>
			</xs:choice>
		</xs:sequence>
	</xs:complexType>	
	
<!-- Structure Types -->

	<xs:complexType name="StructureType">
		<xs:annotation><xs:documentation>Holds the structure information for submission to the structural repository.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="OrganisationSchemes" type="structure:OrganisationSchemesType" minOccurs="0"/>
			<xs:element name="Dataflows" type="structure:DataflowsType" minOccurs="0"/>
			<xs:element name="Metadataflows" type="structure:MetadataflowsType" minOccurs="0"/>
			<xs:element name="CategorySchemes" type="structure:CategorySchemesType" minOccurs="0"/>					
			<xs:element name="CodeLists" type="structure:CodeListsType" minOccurs="0"/>
			<xs:element name="HierarchicalCodelists" type="structure:HierarchicalCodelistsType" minOccurs="0"/>
			<xs:element name="Concepts" type="structure:ConceptsType" minOccurs="0"/>
			<xs:element name="MetadataStructureDefinitions" type="structure:MetadataStructureDefinitionsType" minOccurs="0"/>
			<xs:element name="KeyFamilies" type="structure:KeyFamiliesType" minOccurs="0"/>
			<xs:element name="StructureSets" type="structure:StructureSetsType" minOccurs="0"/>
			<xs:element name="Processes" type="structure:ProcessesType" minOccurs="0"/>
			<xs:element name="ReportingTaxonomies" type="structure:ReportingTaxonomiesType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="SubmittedStructureType">
		<xs:annotation><xs:documentation>SubmittedStructure holds a reference to a structural object to be stored in the repository. The externalDependencies attribute should be set to true if the repository is expected to use URLs in the structure Message to retrieve objects on which the stored object has dependencies. (Thus, if a key family is being submitted to the repository, and the structure message has URLKs which point to the locations of the codelists it uses, then the externalDependencies attribute should be set to true.) the action attribute specifies whether the Structure being submitted is intended to be added or deleted from the repository. The "modify" action is not applicable to final structures in the repository, and will produce an error condition, as these can be versioned but not modified.To submit a later version of a structure, the structure message should include the incremented version number. The externalDependencies and action attributes need not be specified in a response document. The isFinal attribute indicates whether the structure being submitted to the repository is final or not - this can also be specified on the structures themselves.</xs:documentation></xs:annotation>
		<xs:choice>
			<xs:element name="DataflowRef" type="DataflowRefType"/>
			<xs:element name="MetadataflowRef" type="MetadataflowRefType"/>			
			<xs:element name="CodelistRef" type="CodelistRefType"/>
			<xs:element name="HierarchicalCodelistRef" type="HierarchicalCodelistRefType"/>			
			<xs:element name="CategorySchemeRef" type="CategorySchemeRefType"/>
			<xs:element name="ConceptSchemeRef" type="ConceptSchemeRefType"/>
			<xs:element name="OrganisationSchemeRef" type="OrganisationSchemeRefType"/>
			<xs:element name="KeyFamilyRef" type="KeyFamilyRefType"/>
			<xs:element name="MetadataStructureRef" type="MetadataStructureRefType"/>
			<xs:element name="ProcessRef" type="ProcessRefType"/>
			<xs:element name="StructureSetRef" type="StructureSetRefType"/>			
			<xs:element name="ReportingTaxonomyRef" type="ReportingTaxonomyRefType"/>			
			
		</xs:choice>
		<xs:attribute name="externalDependencies" type="xs:boolean" use="optional"/>
		<xs:attribute name="action" type="common:ActionType" use="optional"/> 
		<xs:attribute name="isFinal" type="xs:boolean" use="optional"/>
	</xs:complexType>
	
	<xs:complexType name="SubmissionResultType">
		<xs:annotation><xs:documentation>For each Structure object submitted to the repository in a SubmitStructure, a SubmissionResult will be returned. It will identify the object submitted, report back the action requested, and convey the status and any error messages which are relevant to the submission.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="SubmittedStructure" type="SubmittedStructureType"/>
			<xs:element name="StatusMessage" type="StatusMessageType"/>
		</xs:sequence>
	</xs:complexType>	

	
<!-- Reused types -->	

	<xs:complexType name="ProvisionAgreementRefType">
		<xs:annotation><xs:documentation>ProvisionAgreementRef allows for the identification of a provision agreement. At a minimum, either the URN element - holding a valid registry URN - or the set of OragnisationSchemeAgencyID, OrganisationSchemeID, DataProviderID, DataflowAgencyID, and DataflowID must be specified. When used in a response document of any type, the URN must always be provided. Datasource can be used to specify a datasource for the provision agreement. Constraint can be used to express constraints associated with the provision agreement.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>
			<xs:element name="OrganisationSchemeAgencyID" type="common:IDType" minOccurs="0"/>
			<xs:element name="OrganisationSchemeID" type="common:IDType" minOccurs="0"/>
			<xs:element name="DataProviderID" type="common:IDType" minOccurs="0"/>
			<xs:element name="DataProviderVersion" type="xs:string" minOccurs="0"/>
			<xs:element name="DataflowAgencyID" type="common:IDType" minOccurs="0"/>
			<xs:element name="DataflowID" type="common:IDType" minOccurs="0"/>
			<xs:element name="DataflowVersion" type="xs:string" minOccurs="0"/>
			<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
			<xs:element name="Constraint" type="common:ConstraintType" minOccurs="0"/>			
		</xs:sequence>
	</xs:complexType>



	<xs:complexType name="MetadataflowRefType">
			<xs:annotation>
				<xs:documentation>The MetadataflowRef type structures a reference to a metadataflow definition. This requires that ID are provided for a pre-existing Agency and Metadataflow Definition in the registry. The Version element may be used to specify the version of the indicated dataflow. If absent, the most recent version is assumed. The URN element is used to provide the registry-specific URN as an alternate means of identification. When used in a response document of any type, the URN must always be provided. At a minimum, either the URN element or AgencyID, MetadataflowID, and (optionally) version must be supplied. Datasource may be used to specify a datasource. Constraint can be used to provide constraints associated with the metadataflow.</xs:documentation>
			</xs:annotation>
							
				<xs:sequence>
					<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>
					<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
					<xs:element name="MetadataflowID" type="common:IDType"  minOccurs="0"/>
					<xs:element name="Version" type="xs:string" minOccurs="0"/>
					<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
					<xs:element name="Constraint" type="common:ConstraintType" minOccurs="0"/>					
				</xs:sequence>

	</xs:complexType>
	
	<xs:complexType name="DataflowRefType">
				<xs:annotation>
					<xs:documentation>The DataflowRef type structures a reference to a dataflow definition. This requires that ID are provided for a pre-existing Agency and Dataflow Definition in the registry. The Version element may be used to specify the version of the indicated dataflow. If absent, the most recent version is assumed. The URN element is used to provide the registry-specific URN as an alternate means of identification. At a minimum, either the URN element or AgencyID, DataflowID, and (optionally) version must be supplied. When used in a response document of any type, the URN must always be provided. Datasource may be used to specify a datasource. Constraints can be used to specify constraints associated with the dataflow.</xs:documentation>
				</xs:annotation>
								
				<xs:sequence>
					<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>
					<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
					<xs:element name="DataflowID" type="common:IDType"  minOccurs="0"/>
					<xs:element name="Version" type="xs:string" minOccurs="0"/>
					<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
					<xs:element name="Constraint" type="common:ConstraintType" minOccurs="0"/>						
				</xs:sequence>
	
	</xs:complexType>
	<xs:complexType name="DataProviderRefType">
			<xs:annotation>
				<xs:documentation>The DataProviderRef type structures a reference to a data provider. This requires that IDs be provided for an organisation scheme, its maintenance agency, and the data prov ider as identified in the referenced organisation scheme. The Version element may be used to specify the version of the indicated data provider. If absent, the most recent version is assumed. The URN element is used to provide the registry-specific urn as an alternate means of identification. At a minimum, either the URN element or OrgansisationSchemeID, OrganisationSchemeAgencyID, DataProviderID, and (optionally) Version must be supplied. When used in a response document of any type, the URN must always be provided. Datasource may be used to specify a datasource. Constraints can be used to specify constraints associated with the data provider.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>			
				<xs:element name="OrganisationSchemeAgencyID" type="common:IDType"/>
				<xs:element name="OrganisationSchemeID" type="common:IDType"/>
				<xs:element name="DataProviderID" type="common:IDType"/>	
				<xs:element name="Version" type="xs:string" minOccurs="0"/>
				<xs:element name="Datasource" type="DatasourceType" minOccurs="0"/>
				<xs:element name="Constraint" type="common:ConstraintType" minOccurs="0"/>
			</xs:sequence>
			
	</xs:complexType>
	
	<xs:complexType name="AgencyRefType">
			<xs:annotation>
				<xs:documentation>The AgencyRef type structures a reference to an Agency. This requires that IDs be provided for an organisation scheme, its maintenance agency, and the agency as identified in the referenced organisation scheme. The Version element may be used to specify the version of the indicated agency. If absent, the most recent version is assumed. The URN element is used to provide the registry-specific urn as an alternate means of identification. At a minimum, either the URN element or OrgansisationSchemeID, OrganisationSchemeAgencyID, AgencyID, and (optionally) Version must be supplied. When used in a response document of any type, the URN must always be provided. </xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>			
				<xs:element name="OrganisationSchemeAgencyID" type="common:IDType"/>
				<xs:element name="OrganisationSchemeID" type="common:IDType"/>
				<xs:element name="AgencyID" type="common:IDType"/>	
				<xs:element name="Version" type="xs:string" minOccurs="0"/>				
			</xs:sequence>
			
	</xs:complexType>	
	
	<xs:complexType name="CodelistRefType">
			<xs:annotation>
				<xs:documentation>KeyFamilyRef allows for references to specific codelists. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="CodelistID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>				
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="CategorySchemeRefType">
			<xs:annotation>
				<xs:documentation>CategorySchemeRef allows for references to specific category schemes. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="CategorySchemeID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ConceptSchemeRefType">
			<xs:annotation>
				<xs:documentation>ConceptSchemeRef allows for references to specific concept schemes. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="ConceptSchemeID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="OrganisationSchemeRefType">
			<xs:annotation>
				<xs:documentation>OrganisationSchemeRef allows for references to specific organisation schemes. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="OrganisationSchemeID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="KeyFamilyRefType">
			<xs:annotation>
				<xs:documentation>KeyFamilyRef allows for references to specific key families (data structure definitions). At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="KeyFamilyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="MetadataStructureRefType">
			<xs:annotation>
				<xs:documentation>MetadataStructureRef allows for references to specific metadata structure definitions. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="MetadataStructureID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="HierarchicalCodelistRefType">
			<xs:annotation>
				<xs:documentation>HierarchicalCodelistRef allows for references to specific hierarchical codelists. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="HierarchicalCodelistID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="StructureSetRefType">
			<xs:annotation>
				<xs:documentation>StructureSetRef allows for references to specific structure sets. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="StructureSetID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ProcessRefType">
			<xs:annotation>
				<xs:documentation>ProcessRef allows for references to specific processes. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="ProcessID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ReportingTaxonomyRefType">
			<xs:annotation>
				<xs:documentation>ReportingTaxonomyRef allows for references to specific reporting taxonomies. At a minimum, either the URN - which contains a valid Registry/Repository URN - or the rest of the child elements must be supplied. When used in a response document of any type, the URN must always be provided.</xs:documentation>
			</xs:annotation>
			<xs:sequence>
				<xs:element name="URN" type="xs:anyURI" minOccurs="0"/>	
				<xs:element name="AgencyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="ReportingTaxonomyID" type="common:IDType"  minOccurs="0"/>
				<xs:element name="Version" type="xs:string" minOccurs="0"/>					
			</xs:sequence>
	</xs:complexType>



	<xs:complexType name="StatusMessageType">
		<xs:annotation><xs:documentation>This carries the text of error messages and/or warnings in response to queries or requests. The Status attribute carries the staus of the query or request.</xs:documentation></xs:annotation>
		<xs:sequence>
			<xs:element name="MessageText" type="common:TextType" maxOccurs="unbounded" minOccurs="0"/>
		</xs:sequence>
		<xs:attribute name="status" type="StatusType" use="required"/>
	</xs:complexType>

	
<!-- Simple Types -->	
	<xs:simpleType name="ConstraintTypeType">
			<xs:annotation>
				<xs:documentation>ConstraintType provides an enumeration of values of the types of constraints.</xs:documentation>
			</xs:annotation>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="Content">
					<xs:annotation>
						<xs:documentation>Content constraint.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
				<xs:enumeration value="Attachment">
					<xs:annotation>
						<xs:documentation>Attachment constraint.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
			</xs:restriction>
	</xs:simpleType>	
	
	
	
	<xs:simpleType name="StatusType">
			<xs:annotation>
				<xs:documentation>StatusType provides an enumeration of values that detail the status of queries or requests.</xs:documentation>
			</xs:annotation>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="Success">
					<xs:annotation>
						<xs:documentation>Query or request successful.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
				<xs:enumeration value="Warning">
					<xs:annotation>
						<xs:documentation>Query or request successful, but with warnings.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
				<xs:enumeration value="Failure">
					<xs:annotation>
						<xs:documentation>Query or request not successful.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
			</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="QueryTypeType">
			<xs:annotation>
				<xs:documentation>QueryType provides an enumeration of values which specify the objects in the result-set for a registry query.</xs:documentation>
			</xs:annotation>
			<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="DataSets">
					<xs:annotation>
						<xs:documentation>Only references data sets should be returned.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
				<xs:enumeration value="MetadataSets">
					<xs:annotation>
						<xs:documentation>Only references to metadata sets should be returned.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
				<xs:enumeration value="AllSets">
					<xs:annotation>
						<xs:documentation>References to both data sets and metadata sets should be returned.</xs:documentation>
					</xs:annotation>
				</xs:enumeration>
			</xs:restriction>
	</xs:simpleType>
	
	
	


</xs:schema>