<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.irs.gov/efile" xmlns="http://www.irs.gov/efile" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">

	<xsd:annotation>
		<xsd:documentation>
			<Description>IRS e-file Corporate Income Tax Schema - IRS Form 8838</Description>
			<TaxYear>2012</TaxYear>
			<MaturityLevel>Draft Release</MaturityLevel>
			<ReleaseDate>September 5, 2012</ReleaseDate>
		</xsd:documentation>
	</xsd:annotation>

	<xsd:include schemaLocation="../../../Common/efileTypes.xsd"/>


	<!-- =============================================================== -->
	<!-- ======================  IRS Form 8838 ========================= -->
	<!-- =============================================================== -->

 
	<xsd:element name="IRS8838">
		<xsd:annotation>
			<xsd:documentation>IRS Form 8838</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="IRS8838Type">
					<xsd:attributeGroup ref="DocumentAttributes">
						<xsd:annotation>
							<xsd:documentation>Common return document attributes</xsd:documentation>
						</xsd:annotation>
					</xsd:attributeGroup>
					<xsd:attribute name="documentName" type="xsd:string" fixed="IRS8838">
						<xsd:annotation>
							<xsd:documentation>IRS internal use only. To avoid error in the return, do not include the attribute name or value.</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>

					<xsd:attribute name="referenceDocumentId" type="IdListType" />
					<xsd:attribute name="referenceDocumentName" type="StringType" fixed="BinaryAttachment" />

				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="IRS8838Type">
		<xsd:annotation>
			<xsd:documentation>Content model for Form 8838</xsd:documentation>
		</xsd:annotation>

		<xsd:sequence>

			<!-- Name(s) of Consenting Taxpayer(s) -->
			<xsd:element name="NamesOfConsentingTaxpayers" type="BusinessNameType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Name(s) of consenting taxpayer(s)</Description>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Identifying Number Of Payor Of Income (EIN or Missing EIN Reason) -->
			<xsd:choice minOccurs="0">
			
				<!-- Identifying Number -->
				<xsd:element name="EIN" type="EINType">
					<xsd:annotation>
						<xsd:documentation>
							<Description>EIN</Description>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			
				<!-- Missing EIN Reason -->
				<xsd:element name="MissingEINReason">
					<xsd:annotation>
						<xsd:documentation>
							<Description>Missing EIN reason</Description>
						</xsd:documentation>
					</xsd:annotation>
					<xsd:simpleType>
						<xsd:restriction base="StringType">
							<xsd:enumeration value="APPLD FOR"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:element>
			</xsd:choice>

			<!-- Address -->
			<xsd:element name="Address" type="USAddressType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Address</Description>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Tax Period End Date -->
			<xsd:element name="TaxPeriodEndDate" type="DateType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Tax period end date</Description>
						<LineNumber>1</LineNumber>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Expiration Date -->
			<xsd:element name="ExpirationDate" type="DateType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Expiration date</Description>
						<LineNumber>1</LineNumber>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Date of Transfer -->
			<xsd:element name="DateOfTransfer" type="DateType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Date of transfer</Description>
						<LineNumber>5a</LineNumber>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Description of Property Transferred -->
			<xsd:element name="DescOfPropertyTransferred" type="ShortExplanationType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Description of property transferred</Description>
						<LineNumber>5b</LineNumber>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- Name of Transferee -->
			<xsd:element name="NameOfTransferee" type="BusinessNameType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<Description>Name of transferee</Description>
						<LineNumber>5c</LineNumber>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>

			<!-- EIN of Transferee or EIN Missing Reason -->
			<xsd:choice minOccurs="0">
				
				<!-- EIN of Transferee -->
				<xsd:element name="EINOfTransferee" type="EINType">
					<xsd:annotation>
						<xsd:documentation>
							<Description>EIN of transferee</Description>
							<LineNumber>5c</LineNumber>
						</xsd:documentation>
					</xsd:annotation>
				</xsd:element>
			
				<!-- EIN Missing Reason -->
				<xsd:element name="EINMissingReason">
					<xsd:annotation>
						<xsd:documentation>
							<Description>EIN missing reason</Description>
							<LineNumber>5c</LineNumber>
						</xsd:documentation>
					</xsd:annotation>
					<xsd:simpleType>
						<xsd:restriction base="StringType">
							<xsd:enumeration value="APPLD FOR"/>
							<xsd:enumeration value="FOREIGNUS"/>
						</xsd:restriction>
					</xsd:simpleType>
				</xsd:element>
			</xsd:choice>

		</xsd:sequence>

	</xsd:complexType>

</xsd:schema>
