<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://entp.hud.gov" targetNamespace="http://entp.hud.gov"
            elementFormDefault="qualified">
<!-- elements -->
<xsd:element name="EMORTGAGE_PACKAGE" type="envelopePackageType"/>

<!-- complex types -->
<xsd:complexType name="envelopePackageType">
	<xsd:sequence>
		<xsd:element name="KEY" type="keyType"/>
		<xsd:element name="SMART_DOCUMENT" type="smartDocType"/>
	</xsd:sequence>
	<xsd:attribute name="_ID" type="envelopeType"/>
</xsd:complexType>

<xsd:complexType name="keyType">
	<xsd:attribute name="_Name" type="nameType"/>
	<xsd:attribute name="_Value" type="keyValueType"/>
</xsd:complexType>

<xsd:complexType name="smartDocType">
	<xsd:sequence>
		<xsd:element name="HEADER" type="headerType"/>
		<xsd:element name="DATA" type="dataType"/>
	</xsd:sequence>
	<xsd:attribute name="MISMOVersionIdentifier" type="MISMOVersionIdentifierType"/>
	<xsd:attribute name="PopulatingSystemDocumentIdentifier" type="PopulatingSystemDocumentIdentifierType"/>
</xsd:complexType>

<xsd:complexType name="headerType">
	<xsd:sequence>
		<xsd:element name="DOCUMENT_INFORMATION" type="docInfoType"/>
	</xsd:sequence>
	<xsd:attribute name="_ID" type="headerIDType"/>
</xsd:complexType>

<xsd:complexType name="docInfoType">
	<xsd:attribute name="MustBeRecordedIndicator" type="MustBeRecordedIndicatorType"/>
	<xsd:attribute name="NegotiableInstrumentIndicator" type="NegotiableInstrumentIndicatorType"/>
	<xsd:attribute name="SMARTDocumentCategoryType" type="SMARTDocumentCategoryTypeType"/>
	<xsd:attribute name="_FormNumberIdentifier" type="FormNumberIdentifierType"/>
	<xsd:attribute name="_StateType" type="StateTypeType"/>
	<xsd:attribute name="_Type" type="docTypeType"/>
	<xsd:attribute name="_CertificateType" type="CertificateTypeDescriptionType"/>
</xsd:complexType>

<xsd:complexType name="dataType">
	<xsd:sequence>
		<xsd:element name="MAIN" type="mainType"/>
	</xsd:sequence>
	<xsd:attribute name="_ID" type="docIDType"/>
</xsd:complexType>

<xsd:complexType name="mainType">
	<xsd:sequence minOccurs="1" maxOccurs="unbounded">
		<xsd:element name="APPLICATION" type="appType"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="appType">
	<xsd:sequence>
		<xsd:element name="PROPERTY" type="propType" minOccurs="1" maxOccurs="1"/>
		<xsd:element name="BORROWER" type="borrType" minOccurs="1" maxOccurs="1"/>
		<xsd:element name="CASENUMBER" type="xsd:string" minOccurs="1" maxOccurs="1"/>
		<xsd:element name="ORIGINATOR" type="originatorType" minOccurs="1" maxOccurs="1"/>
		<xsd:element name="CANCELLATION" type="cancType" minOccurs="1" maxOccurs="1"/>
	</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="propType">
	<xsd:attribute name="_City" type="xsd:string"/>
	<xsd:attribute name="_PostalCode" type="xsd:string"/>
	<xsd:attribute name="_State" type="xsd:string"/>
	<xsd:attribute name="_StreetAddress" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="borrType">
	<xsd:attribute name="_FirstName" type="xsd:string"/>
	<xsd:attribute name="_LastName" type="xsd:string"/>
	<xsd:attribute name="_MiddleName" type="xsd:string"/>
	<xsd:attribute name="_NameSuffix" type="xsd:string"/>
</xsd:complexType>

<xsd:complexType name="originatorType">
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="_ID" type="xsd:string"/>
				<xsd:attribute name="_EIN" type="xsd:string"/>
            </xsd:extension>
        </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="cancType">
        <xsd:simpleContent>
            <xsd:extension base="xsd:string">
                <xsd:attribute name="_Reason" type="reasonType"/>
            </xsd:extension>
        </xsd:simpleContent>
</xsd:complexType>

<!-- simple types -->

<xsd:simpleType name="nameType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="TransactionMode"/>
		<xsd:enumeration value="TransactionStatus"/>
		<xsd:enumeration value="TransactionMessage"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="keyValueType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="Query"/>
		<xsd:enumeration value="Cancel"/>
		<xsd:enumeration value="Reinstate"/>
		<xsd:enumeration value="xsd:string"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="reasonType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="Transaction Not Completed"/>
		<xsd:enumeration value="Appraisal Expired"/>
		<xsd:enumeration value="Different Financing"/>
		<xsd:enumeration value="Case Closed not Endorsed"/>
		<xsd:enumeration value="Different MIP Structure"/>
		<xsd:enumeration value="Automatic System Cancel"/>
		<xsd:enumeration value="Automatic Condo Cancel"/>
		<xsd:enumeration value="Other"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="envelopeType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="HUD_PROCESS"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="MISMOVersionIdentifierType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="1.01"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="headerIDType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="FHAVA_Header"/>
	</xsd:restriction>
</xsd:simpleType>


<xsd:simpleType name="PopulatingSystemDocumentIdentifierType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="FHAVA"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="MustBeRecordedIndicatorType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="False"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="NegotiableInstrumentIndicatorType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="False"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="SMARTDocumentCategoryTypeType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="5"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="FormNumberIdentifierType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="OMB-2502-0524"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="StateTypeType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="Populated"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="docTypeType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="Other"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="docIDType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="FHAVA_CASE_CANCEL_REINSTATE"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="mismoIDType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="2.3"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="BooleanIndicatorType">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value="YES"/>
		<xsd:enumeration value="Yes"/>
		<xsd:enumeration value="yes"/>
		<xsd:enumeration value="Y"/>
		<xsd:enumeration value="y"/>
		<xsd:enumeration value="NO"/>
		<xsd:enumeration value="No"/>
		<xsd:enumeration value="no"/>
		<xsd:enumeration value="N"/>
		<xsd:enumeration value="n"/>
		<xsd:enumeration value="N/A"/>
	</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="boolean">
	<xsd:restriction base="xsd:string">
		<xsd:enumeration value=" "/>
		<xsd:enumeration value="Y"/>
		<xsd:enumeration value="Y"/>
		<xsd:enumeration value="Yes"/>
		<xsd:enumeration value="YES"/>
		<xsd:enumeration value="yes"/>
		<xsd:enumeration value="n"/>
		<xsd:enumeration value="N"/>
		<xsd:enumeration value="No"/>
		<xsd:enumeration value="NO"/>
		<xsd:enumeration value="no"/>
	</xsd:restriction>
</xsd:simpleType>

</xsd:schema>