<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

      <!-- String Type -->

      <xsd:simpleType name="StringType">

            <xsd:annotation>

                  <xsd:documentation>Base type for a string</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:string"/>

      </xsd:simpleType>

      <xsd:simpleType name="LocalCodeType">

            <xsd:annotation>

                  <xsd:documentation>Local code, 4 numeric values</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:string">

                  <xsd:pattern value="[0-9]{4}"/>

            </xsd:restriction>

      </xsd:simpleType>

      <xsd:simpleType name="ThreeAlphaIdentifierType">

            <xsd:annotation>

                  <xsd:documentation>3 alpha values</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:string">

                  <xsd:pattern value="[a-zA-Z]{3}"/>

            </xsd:restriction>

      </xsd:simpleType>

      <xsd:simpleType name="IdentifierTypes">

            <xsd:annotation>

                  <xsd:documentation>########AAA</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:string">

                  <xsd:pattern value="[0-9]{8}[a-zA-Z]{3}"/>

                  <xsd:pattern value="[0-9]{11}"/>

            </xsd:restriction>

      </xsd:simpleType>

      <xsd:simpleType name="ZeroOrOneType">

            <xsd:annotation>

                  <xsd:documentation>0 or 1 values</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:string">

                  <xsd:pattern value="[0-1]{1}"/>

            </xsd:restriction>

      </xsd:simpleType>

      <!-- Date Type in the format of YYYY-MM-DD -->

      <xsd:simpleType name="DateType">

            <xsd:annotation>

                  <xsd:documentation>Base type for a date</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:date">

                  <xsd:pattern value="[1-9][0-9]{3}\-.*"/>

            </xsd:restriction>

      </xsd:simpleType>

      <xsd:simpleType name="LongIntegerType">

            <xsd:annotation>

                  <xsd:documentation>Base type for a long integer. Range of values is: -9,223,372,036,854,775,808 thru 9,223,372,036,854,775,807</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:long"/>

      </xsd:simpleType>

      <xsd:simpleType name="IntegerType">

            <xsd:annotation>

                  <xsd:documentation>Base type for a long integer. Range of values is: -9,223,372,036,854,775,808 thru 9,223,372,036,854,775,807</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:int"/>

      </xsd:simpleType>

      <!-- US Currency Type -->

      <xsd:simpleType name="USCurType">

            <xsd:annotation>

                  <xsd:documentation>A decimal with  2 fraction digits</xsd:documentation>

            </xsd:annotation>

            <xsd:restriction base="xsd:decimal">

                  <xsd:fractionDigits value="2"/>

            </xsd:restriction>

      </xsd:simpleType>

      <xsd:complexType name="BTCHDRType">

            <xsd:sequence>

                  <xsd:element name="BatchID" type="StringType"/>

                  <xsd:element name="BatchType" type="StringType"/>

                  <xsd:element name="AccountType" type="StringType"/>

                  <xsd:element name="BatchSource" type="StringType"/>

                  <xsd:element name="PostmarkDate" type="DateType"/>

                  <xsd:element name="BatchDate" type="DateType"/>

                  <xsd:element name="FilingPeriod" type="DateType"/>

                  <xsd:element name="TotalItems" type="IntegerType"/>

            </xsd:sequence>

      </xsd:complexType>

      <xsd:complexType name="RTNDTLType">

            <xsd:sequence>

                  <xsd:element name="IdentifierType" type="ThreeAlphaIdentifierType"/>

                  <xsd:element name="Identifier" type="IdentifierTypes"/>

                  <xsd:element name="Amended" type="ZeroOrOneType"/>

                  <xsd:element name="FilingPeriod" type="DateType"/>

                  <xsd:element name="ReceivedDate" type="DateType" minOccurs="0"/>

                  <xsd:element name="Name" type="StringType"/>

            </xsd:sequence>

      </xsd:complexType>

      <xsd:complexType name="RTNDTAType">

            <xsd:sequence>

                  <xsd:element name="JanWth" type="USCurType"/>

                  <xsd:element name="FebWth" type="USCurType"/>

                  <xsd:element name="MarWth" type="USCurType"/>

                  <xsd:element name="AprWth" type="USCurType"/>

                  <xsd:element name="MayWth" type="USCurType"/>

                  <xsd:element name="JuneWth" type="USCurType"/>

                  <xsd:element name="JulyWth" type="USCurType"/>

                  <xsd:element name="AugWth" type="USCurType"/>

                  <xsd:element name="SeptWth" type="USCurType"/>

                  <xsd:element name="OctWth" type="USCurType"/>

                  <xsd:element name="NovWth" type="USCurType"/>

                  <xsd:element name="DecWth" type="USCurType"/>

            </xsd:sequence>

      </xsd:complexType>

      <xsd:complexType name="RTNFTRType">

            <xsd:sequence>

                  <xsd:element name="TotalWth" type="USCurType"/>

                  <xsd:element name="TotalTaxPaid" type="USCurType"/>

                  <xsd:element name="TotalWagesPaid" type="USCurType"/>

                  <xsd:element name="TotalEmployees" type="IntegerType"/>

            </xsd:sequence>

      </xsd:complexType>

      <xsd:complexType name="WithholdingReturnType">

            <xsd:sequence>

                  <xsd:element name="RTNDTL" type="RTNDTLType"/>

                  <xsd:element name="RTNDTA" type="RTNDTAType"/>

                  <xsd:element name="RTNFTR" type="RTNFTRType"/>

            </xsd:sequence>

      </xsd:complexType>

      <xsd:element name="RtnFile">

            <xsd:complexType>

                  <xsd:sequence>

                        <xsd:element name="BTCHDR" type="BTCHDRType" minOccurs="0" maxOccurs="0"/>

                        <xsd:element name="WthReturn" type="WithholdingReturnType" maxOccurs="unbounded"/>

                  </xsd:sequence>

            </xsd:complexType>

      </xsd:element>

</xsd:schema>

 
