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

  <xsd:annotation>
    <xsd:documentation>
      <Description>IRS e-file Partnership Income Return - Ownership of Any Interest in Another Partnership or Foreign Entity Statement</Description>
      <TaxYear>2018</TaxYear>
      <MaturityLevel>Final Release</MaturityLevel>
      <ReleaseDate>November 28, 2018</ReleaseDate>
    </xsd:documentation>
  </xsd:annotation>
  
  <xsd:include schemaLocation="../../../Common/efileTypes.xsd"/>
  
  
  <!-- ======================================================================================== -->
  <!-- ===  Ownership of Any Interest in Another Partnership or Foreign Entity Statement   ==== -->
  <!-- ======================================================================================== -->
  
  
  <xsd:element name="OwnershipAnyInterestPrtshpStmt">
    <xsd:annotation>
      <xsd:documentation>Ownership of any interest in another partnership or foreign entity statement</xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:complexContent>
        <xsd:extension base="OwnershipInterestPrtshpStmtTyp">
          <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="OwnershipOfAnyInterestInAnotherPartnershipOrForeignEntityStmt">
            <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:extension>
      </xsd:complexContent>
    </xsd:complexType>
  </xsd:element>
  
  <xsd:complexType name="OwnershipInterestPrtshpStmtTyp">
    <xsd:annotation>
      <xsd:documentation>Content model for ownership of any interest in another partnership or foreign entity statement</xsd:documentation>
    </xsd:annotation>
    
    <xsd:sequence>
    
      <xsd:element name="EntityGrp" minOccurs="0" maxOccurs="unbounded">
        <xsd:complexType>
          <xsd:sequence>
          
            <!-- Type of Entity -->          
            <xsd:element name="EntityTypeTxt" type="LineExplanationType" minOccurs="0">
              <xsd:annotation>
                <xsd:documentation>
                  <Description>Type of entity</Description>
                </xsd:documentation>
              </xsd:annotation>
            </xsd:element>
            
            <!-- Entity Name -->            
            <xsd:element name="EntityName" type="BusinessNameType" minOccurs="0">
              <xsd:annotation>
                <xsd:documentation>
                  <Description>Entity Name</Description>
                </xsd:documentation>
              </xsd:annotation>
            </xsd:element>

						      <!-- Choice between EIN or "APPLD FOR" -->
						      <xsd:choice minOccurs="0">

              <!-- EIN -->          
              <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="MissingEINReasonCd">
            <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>
           
          <!-- Country-->            
            <xsd:element name="CountryCd" type="AllCountriesType" minOccurs="0">
              <xsd:annotation>
                <xsd:documentation>
                  <Description>Country</Description>
                </xsd:documentation>
              </xsd:annotation>
            </xsd:element>            

          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

    </xsd:sequence>
  </xsd:complexType>
  
</xsd:schema>
