<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	          targetNamespace="http://www.abrasf.org.br/nfse.xsd"
            xmlns="http://www.abrasf.org.br/nfse.xsd"
	          xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
            attributeFormDefault="unqualified"
	          elementFormDefault="qualified">
  <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="xmldsig-core-schema20020212.xsd" />

  <!-- definition of simple elements -->
  <xsd:simpleType name="tsNumeroNfse">
    <xsd:restriction base="xsd:nonNegativeInteger">
      <xsd:totalDigits value="15" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoVerificacao">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="9" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
      <xsd:pattern value="[a-zA-Z0-9]{1,9}"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsStatusRps">
    <xsd:annotation>
      <xsd:documentation>
        Situacao do RPS (
        1 - Normal;
        2 - Cancelado)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsStatusNfse">
    <xsd:annotation>
      <xsd:documentation>
        Situacao do RPS (
        1 - Normal;
        2 - Cancelada)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsExigibilidadeISS">
    <xsd:annotation>
      <xsd:documentation>
        Exigibilidade do ISS da NFS-e (
        1 - Exigivel;
        2 - Nao incidencia;
        3 - Isencao;
        4 - Exportacao;
        5 - Imunidade;
        6 - Exigibilidade Suspensa por Decisao Judicial;
        7 - Exigibilidade Suspensa por Processo Administrativo)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2|3|4|5|6|7" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNumeroProcesso">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsRegimeEspecialTributacao">
    <xsd:annotation>
      <xsd:documentation>
        Exigibilidade do ISS da NFS-e (
        1 - Microempresa Municipal;
        2 - Estimativa;
        3 - Sociedade de Profissionais;
        4 - Cooperativa;
        5 - Microempresario Individual (MEI);
        6 - Microempresario e Empresa de Pequeno Porte (ME EPP))
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2|3|4|5|6" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsSimNao">
    <xsd:annotation>
      <xsd:documentation>
        Sim ou Nao (
        1 - Sim;
        2 - Nao)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsResponsavelRetencao">
    <xsd:annotation>
      <xsd:documentation>
        Responsavel pela retencao do ISSQN (
        1 - Tomador;
        2 - Intermediario)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsPagina">
    <xsd:restriction base="xsd:nonNegativeInteger">
      <xsd:minInclusive value="1" />
      <xsd:maxInclusive value="999999" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNumeroRps">
    <xsd:restriction base="xsd:nonNegativeInteger">
      <xsd:totalDigits value="15" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsSerieRps">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="5" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsTipoRps">
    <xsd:annotation>
      <xsd:documentation>
        Tipo do RPS (
        1 - Recibo Provisorio de Servicos;
        2 - RPS Nota Fiscal Conjugada (Mista);
        3 - Cupom)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2|3" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsOutrasInformacoes">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="255" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsValor">
    <xsd:restriction base="xsd:decimal">
      <xsd:totalDigits value="15" />
      <xsd:fractionDigits value="2" fixed="true" />
      <xsd:minInclusive value="0" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsItemListaServico">
    <xsd:annotation>
      <xsd:documentation>Tipo Codigo da Lista de Servicos LC 116/2003</xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:enumeration value="01.01"/>
      <xsd:enumeration value="01.02"/>
      <xsd:enumeration value="01.03"/>
      <xsd:enumeration value="01.04"/>
      <xsd:enumeration value="01.05"/>
      <xsd:enumeration value="01.06"/>
      <xsd:enumeration value="01.07"/>
      <xsd:enumeration value="01.08"/>
      <xsd:enumeration value="01.09"/>
      <xsd:enumeration value="02.01"/>
      <xsd:enumeration value="03.02"/>
      <xsd:enumeration value="03.03"/>
      <xsd:enumeration value="03.04"/>
      <xsd:enumeration value="03.05"/>
      <xsd:enumeration value="04.01"/>
      <xsd:enumeration value="04.02"/>
      <xsd:enumeration value="04.03"/>
      <xsd:enumeration value="04.04"/>
      <xsd:enumeration value="04.05"/>
      <xsd:enumeration value="04.06"/>
      <xsd:enumeration value="04.07"/>
      <xsd:enumeration value="04.08"/>
      <xsd:enumeration value="04.09"/>
      <xsd:enumeration value="04.10"/>
      <xsd:enumeration value="04.11"/>
      <xsd:enumeration value="04.12"/>
      <xsd:enumeration value="04.13"/>
      <xsd:enumeration value="04.14"/>
      <xsd:enumeration value="04.15"/>
      <xsd:enumeration value="04.16"/>
      <xsd:enumeration value="04.17"/>
      <xsd:enumeration value="04.18"/>
      <xsd:enumeration value="04.19"/>
      <xsd:enumeration value="04.20"/>
      <xsd:enumeration value="04.21"/>
      <xsd:enumeration value="04.22"/>
      <xsd:enumeration value="04.23"/>
      <xsd:enumeration value="05.01"/>
      <xsd:enumeration value="05.02"/>
      <xsd:enumeration value="05.03"/>
      <xsd:enumeration value="05.04"/>
      <xsd:enumeration value="05.05"/>
      <xsd:enumeration value="05.06"/>
      <xsd:enumeration value="05.07"/>
      <xsd:enumeration value="05.08"/>
      <xsd:enumeration value="05.09"/>
      <xsd:enumeration value="06.01"/>
      <xsd:enumeration value="06.02"/>
      <xsd:enumeration value="06.03"/>
      <xsd:enumeration value="06.04"/>
      <xsd:enumeration value="06.05"/>
      <xsd:enumeration value="06.06"/>
      <xsd:enumeration value="07.01"/>
      <xsd:enumeration value="07.02"/>
      <xsd:enumeration value="07.03"/>
      <xsd:enumeration value="07.04"/>
      <xsd:enumeration value="07.05"/>
      <xsd:enumeration value="07.06"/>
      <xsd:enumeration value="07.07"/>
      <xsd:enumeration value="07.08"/>
      <xsd:enumeration value="07.09"/>
      <xsd:enumeration value="07.10"/>
      <xsd:enumeration value="07.11"/>
      <xsd:enumeration value="07.12"/>
      <xsd:enumeration value="07.13"/>
      <xsd:enumeration value="07.16"/>
      <xsd:enumeration value="07.17"/>
      <xsd:enumeration value="07.18"/>
      <xsd:enumeration value="07.19"/>
      <xsd:enumeration value="07.20"/>
      <xsd:enumeration value="07.21"/>
      <xsd:enumeration value="07.22"/>
      <xsd:enumeration value="08.01"/>
      <xsd:enumeration value="08.02"/>
      <xsd:enumeration value="09.01"/>
      <xsd:enumeration value="09.02"/>
      <xsd:enumeration value="09.03"/>
      <xsd:enumeration value="10.01"/>
      <xsd:enumeration value="10.02"/>
      <xsd:enumeration value="10.03"/>
      <xsd:enumeration value="10.04"/>
      <xsd:enumeration value="10.05"/>
      <xsd:enumeration value="10.06"/>
      <xsd:enumeration value="10.07"/>
      <xsd:enumeration value="10.08"/>
      <xsd:enumeration value="10.09"/>
      <xsd:enumeration value="10.10"/>
      <xsd:enumeration value="11.01"/>
      <xsd:enumeration value="11.02"/>
      <xsd:enumeration value="11.03"/>
      <xsd:enumeration value="11.04"/>
      <xsd:enumeration value="11.05"/>
      <xsd:enumeration value="12.01"/>
      <xsd:enumeration value="12.02"/>
      <xsd:enumeration value="12.03"/>
      <xsd:enumeration value="12.04"/>
      <xsd:enumeration value="12.05"/>
      <xsd:enumeration value="12.06"/>
      <xsd:enumeration value="12.07"/>
      <xsd:enumeration value="12.08"/>
      <xsd:enumeration value="12.09"/>
      <xsd:enumeration value="12.10"/>
      <xsd:enumeration value="12.11"/>
      <xsd:enumeration value="12.12"/>
      <xsd:enumeration value="12.13"/>
      <xsd:enumeration value="12.14"/>
      <xsd:enumeration value="12.15"/>
      <xsd:enumeration value="12.16"/>
      <xsd:enumeration value="12.17"/>
      <xsd:enumeration value="13.02"/>
      <xsd:enumeration value="13.03"/>
      <xsd:enumeration value="13.04"/>
      <xsd:enumeration value="13.05"/>
      <xsd:enumeration value="14.01"/>
      <xsd:enumeration value="14.02"/>
      <xsd:enumeration value="14.03"/>
      <xsd:enumeration value="14.04"/>
      <xsd:enumeration value="14.05"/>
      <xsd:enumeration value="14.06"/>
      <xsd:enumeration value="14.07"/>
      <xsd:enumeration value="14.08"/>
      <xsd:enumeration value="14.09"/>
      <xsd:enumeration value="14.10"/>
      <xsd:enumeration value="14.11"/>
      <xsd:enumeration value="14.12"/>
      <xsd:enumeration value="14.13"/>
      <xsd:enumeration value="14.14"/>
      <xsd:enumeration value="15.01"/>
      <xsd:enumeration value="15.02"/>
      <xsd:enumeration value="15.03"/>
      <xsd:enumeration value="15.04"/>
      <xsd:enumeration value="15.05"/>
      <xsd:enumeration value="15.06"/>
      <xsd:enumeration value="15.07"/>
      <xsd:enumeration value="15.08"/>
      <xsd:enumeration value="15.09"/>
      <xsd:enumeration value="15.10"/>
      <xsd:enumeration value="15.11"/>
      <xsd:enumeration value="15.12"/>
      <xsd:enumeration value="15.13"/>
      <xsd:enumeration value="15.14"/>
      <xsd:enumeration value="15.15"/>
      <xsd:enumeration value="15.16"/>
      <xsd:enumeration value="15.17"/>
      <xsd:enumeration value="15.18"/>
      <xsd:enumeration value="16.01"/>
      <xsd:enumeration value="16.02"/>
      <xsd:enumeration value="17.01"/>
      <xsd:enumeration value="17.02"/>
      <xsd:enumeration value="17.03"/>
      <xsd:enumeration value="17.04"/>
      <xsd:enumeration value="17.05"/>
      <xsd:enumeration value="17.06"/>
      <xsd:enumeration value="17.08"/>
      <xsd:enumeration value="17.09"/>
      <xsd:enumeration value="17.10"/>
      <xsd:enumeration value="17.11"/>
      <xsd:enumeration value="17.12"/>
      <xsd:enumeration value="17.13"/>
      <xsd:enumeration value="17.14"/>
      <xsd:enumeration value="17.15"/>
      <xsd:enumeration value="17.16"/>
      <xsd:enumeration value="17.17"/>
      <xsd:enumeration value="17.18"/>
      <xsd:enumeration value="17.19"/>
      <xsd:enumeration value="17.20"/>
      <xsd:enumeration value="17.21"/>
      <xsd:enumeration value="17.22"/>
      <xsd:enumeration value="17.23"/>
      <xsd:enumeration value="17.24"/>
      <xsd:enumeration value="17.25"/>
      <xsd:enumeration value="18.01"/>
      <xsd:enumeration value="19.01"/>
      <xsd:enumeration value="20.01"/>
      <xsd:enumeration value="20.02"/>
      <xsd:enumeration value="20.03"/>
      <xsd:enumeration value="21.01"/>
      <xsd:enumeration value="22.01"/>
      <xsd:enumeration value="23.01"/>
      <xsd:enumeration value="24.01"/>
      <xsd:enumeration value="25.01"/>
      <xsd:enumeration value="25.02"/>
      <xsd:enumeration value="25.03"/>
      <xsd:enumeration value="25.04"/>
      <xsd:enumeration value="25.05"/>
      <xsd:enumeration value="26.01"/>
      <xsd:enumeration value="27.01"/>
      <xsd:enumeration value="28.01"/>
      <xsd:enumeration value="29.01"/>
      <xsd:enumeration value="30.01"/>
      <xsd:enumeration value="31.01"/>
      <xsd:enumeration value="32.01"/>
      <xsd:enumeration value="33.01"/>
      <xsd:enumeration value="34.01"/>
      <xsd:enumeration value="35.01"/>
      <xsd:enumeration value="36.01"/>
      <xsd:enumeration value="37.01"/>
      <xsd:enumeration value="38.01"/>
      <xsd:enumeration value="39.01"/>
      <xsd:enumeration value="40.01"/>
      <xsd:enumeration value="99.99"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoCnae">
    <xsd:restriction base="xsd:int">
      <xsd:totalDigits value="7" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoTributacao">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="20" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoNbs">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="9"/>
      <xsd:minLength value="1"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsAliquota">
    <xsd:restriction base="xsd:decimal">
      <xsd:totalDigits value="4" />
      <xsd:fractionDigits value="2" />
      <xsd:minInclusive value="0" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsDiscriminacao">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="2000" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoMunicipioIbge">
    <xsd:restriction base="xsd:int">
      <xsd:totalDigits value="7" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsInscricaoMunicipal">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="15" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsRazaoSocial">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="150" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNomeFantasia">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="60" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCnpj">
    <xsd:restriction base="xsd:string">
      <xsd:length value="14" fixed="true" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNif">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="40"/>
      <xsd:minLength value="0"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsEndereco">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="125" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNumeroEndereco">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="10" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsComplementoEndereco">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="60" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsBairro">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="60" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsUf">
    <xsd:annotation>
      <xsd:documentation>
        UF (
        AC - Acre;
        AL - Alagoas;
        AM - Amazonas;
        AP - Amapa;
        BA - Bahia;
        CE - Ceara;
        DF - Distrito Federal;
        ES - Espirito Santo;
        GO - Goias;
        MA - Maranhao;
        MG - Minas Gerais;
        MS - Mato Grosso do Sul;
        MT - Mato Grosso;
        PA - Para;
        PB - Paraiba;
        PE - Pernambuco;
        PI - Piaui;
        PR - Parana;
        RJ - Rio de Janeiro;
        RN - Rio Grande do Norte;
        RO - Rondonia;
        RR - Roraima;
        RS - Rio Grande do Sul;
        SC - Santa Catarina;
        SE - Sergipe;
        SP - Sao Paulo;
        TO - Tocantins)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:length value="2" fixed="true" />
      <xsd:whiteSpace value="collapse" />
      <xsd:enumeration value="AC"/>
      <xsd:enumeration value="AL"/>
      <xsd:enumeration value="AM"/>
      <xsd:enumeration value="AP"/>
      <xsd:enumeration value="BA"/>
      <xsd:enumeration value="CE"/>
      <xsd:enumeration value="DF"/>
      <xsd:enumeration value="ES"/>
      <xsd:enumeration value="GO"/>
      <xsd:enumeration value="MA"/>
      <xsd:enumeration value="MG"/>
      <xsd:enumeration value="MS"/>
      <xsd:enumeration value="MT"/>
      <xsd:enumeration value="PA"/>
      <xsd:enumeration value="PB"/>
      <xsd:enumeration value="PE"/>
      <xsd:enumeration value="PI"/>
      <xsd:enumeration value="PR"/>
      <xsd:enumeration value="RJ"/>
      <xsd:enumeration value="RN"/>
      <xsd:enumeration value="RO"/>
      <xsd:enumeration value="RR"/>
      <xsd:enumeration value="RS"/>
      <xsd:enumeration value="SC"/>
      <xsd:enumeration value="SE"/>
      <xsd:enumeration value="SP"/>
      <xsd:enumeration value="TO"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoPaisBacen">
    <xsd:restriction base="xsd:string">
      <xsd:length value="4" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>

  </xsd:simpleType>
  <xsd:simpleType name="tsCep">
    <xsd:restriction base="xsd:string">
      <xsd:length value="8" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsEmail">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="80" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsTelefone">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="20" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCpf">
    <xsd:restriction base="xsd:string">
      <xsd:length value="11" fixed="true" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoObra">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsArt">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="30" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNumeroLote">
    <xsd:restriction base="xsd:nonNegativeInteger">
      <xsd:totalDigits value="15" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsNumeroProtocolo">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="50" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsSituacaoLoteRps">
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2|3|4" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsQuantidadeRps">
    <xsd:restriction base="xsd:int">
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoMensagemAlerta">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="4" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsDescricaoMensagemAlerta">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="200" />
      <xsd:minLength value="1" />
      <xsd:whiteSpace value="collapse" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodigoCancelamentoNfse">
    <xsd:annotation>
      <xsd:documentation>
        Codigo do Cancelamento da NFS-e (
        1 - Erro na emissao;
        2 - Servico nao prestado;
        3 - Erro de assinatura;
        4 - Duplicidade da nota;
        5 - Erro de processamento)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:pattern value="1|2|3|4|5" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsIdTag">
    <xsd:restriction base="xsd:string">
      <xsd:maxLength value="255" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="tsVersao">
    <xsd:restriction base="xsd:token">
      <xsd:pattern value="[1-9]{1}[0-9]{0,1}\.[0-9]{2}" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="tsChaveADN">
    <xsd:annotation>
      <xsd:documentation>
        Informar o identificador precedido do literal ‘NFS’. A regra de formação do identificador de 53 posições da NFS-e é:
        "NFS" + Cód.Mun.(7) + Amb.Ger.(1) + Tipo de Inscrição Federal(1) + Inscrição Federal(14) + No.NFS-e(13) + AnoMes Emis.(4) + Cód.Num.(9) + DV(1)
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:maxLength value="53"/>
      <xsd:pattern value="NFS[0-9]{50}"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsMotivoNifNaoInformado">
    <xsd:annotation>
      <xsd:documentation>
        Motivo para não informação do NIF:
        0 - Não informado na nota de origem;
        1 - Dispensado do NIF;
        2 - Não exigência do NIF;
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:enumeration value="0"/>
      <xsd:enumeration value="1"/>
      <xsd:enumeration value="2"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsSituacaoTributariaPISCOFINS">
    <xsd:annotation>
      <xsd:documentation>
        Código de Situação Tributária do PIS/COFINS (CST):
        00 - Nenhum;
        01 - Operação Tributável com Alíquota Básica;
        02 - Operação Tributável com Alíquota Diferenciada;
        03 - Operação Tributável com Alíquota por Unidade de Medida de Produto;
        04 - Operação Tributável monofásica - Revenda a Alíquota Zero;
        05 - Operação Tributável por Substituição Tributária;
        06 - Operação Tributável a Alíquota Zero;
        07 - Operação Tributável da Contribuição;
        08 - Operação sem Incidência da Contribuição;
        09 - Operação com Suspensão da Contribuição;
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:enumeration value="00"/>
      <xsd:enumeration value="01"/>
      <xsd:enumeration value="02"/>
      <xsd:enumeration value="03"/>
      <xsd:enumeration value="04"/>
      <xsd:enumeration value="05"/>
      <xsd:enumeration value="06"/>
      <xsd:enumeration value="07"/>
      <xsd:enumeration value="08"/>
      <xsd:enumeration value="09"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsIndFinal">
    <xsd:annotation>
      <xsd:documentation>
        Indica operação de uso ou consumo pessoal (art. 57):
        0 - Não;
        1 - Sim;
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:byte">
      <xsd:enumeration value="0"/>
      <xsd:enumeration value="1"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodIndOp">
    <xsd:annotation>
      <xsd:documentation>
        Código indicador da operação de fornecimento, conforme tabela "código indicador de operação"
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:pattern value="[0-9]{6}"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodSitTrib">
    <xsd:annotation>
      <xsd:documentation>
        Código de Situação Tributária
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:pattern value="[0-9]{3}"/>
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:simpleType name="tsCodClassTrib">
    <xsd:annotation>
      <xsd:documentation>
        Código de Classificação Tributária
      </xsd:documentation>
    </xsd:annotation>
    <xsd:restriction base="xsd:string">
      <xsd:whiteSpace value="preserve"/>
      <xsd:pattern value="[0-9]{6}"/>
    </xsd:restriction>
  </xsd:simpleType>

  <!-- definition of complex elements -->
  <xsd:complexType name="tcCpfCnpj">
    <xsd:choice>
      <xsd:element name="Cpf" type="tsCpf" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="Cnpj" type="tsCnpj" minOccurs="1"
				maxOccurs="1" />
    </xsd:choice>
  </xsd:complexType>

  <xsd:complexType name="tcEndereco">
    <xsd:sequence>
      <xsd:element name="Endereco" type="tsEndereco" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="Numero" type="tsNumeroEndereco"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Complemento" type="tsComplementoEndereco"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Bairro" type="tsBairro" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Uf" type="tsUf" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="CodigoPais" type="tsCodigoPaisBacen"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Cep" type="tsCep" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcContato">
    <xsd:sequence>
      <xsd:element name="Telefone" type="tsTelefone" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="Email" type="tsEmail" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoOrgaoGerador">
    <xsd:sequence>
      <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Uf" type="tsUf" minOccurs="1"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoRps">
    <xsd:sequence>
      <xsd:element name="Numero" type="tsNumeroRps" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="Serie" type="tsSerieRps" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="Tipo" type="tsTipoRps" minOccurs="1"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoPrestador">
    <xsd:sequence>
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoTomador">
    <xsd:sequence>
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoConsulente">
    <xsd:sequence>
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoIntermediario">
    <xsd:sequence>
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="0" maxOccurs="1"/>
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcDadosTomador">
    <xsd:sequence>
      <xsd:element name="IdentificacaoTomador" type="tcIdentificacaoTomador"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="NifTomador" type="tsNif"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="MotivoNifNaoInformado" type="tsMotivoNifNaoInformado"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="RazaoSocial" type="tsRazaoSocial"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Endereco" type="tcEndereco" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="Contato" type="tcContato" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcDadosIntermediario">
    <xsd:sequence>
      <xsd:element name="IdentificacaoIntermediario" type="tcIdentificacaoIntermediario" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="RazaoSocial" type="tsRazaoSocial" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge" minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcValoresDeclaracaoServico">
    <xsd:sequence>
      <xsd:element name="ValorServicos" type="tsValor"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="ValorDeducoes" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ValorPis" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorCofins" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorInss" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorIr" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorCsll" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="OutrasRetencoes" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ValTotTributos" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ValorIss" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="Aliquota" type="tsAliquota" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="DescontoIncondicionado" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="DescontoCondicionado" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="SituacaoTributariaPISCOFINS" type="tsSituacaoTributariaPISCOFINS" minOccurs="0" 
        maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcValoresNfse">
    <xsd:sequence>
      <xsd:element name="BaseCalculo" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="Aliquota" type="tsAliquota" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorIss" type="tsValor" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ValorLiquidoNfse" type="tsValor"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcDadosServico">
    <xsd:sequence>
      <xsd:element name="Valores" type="tcValoresDeclaracaoServico" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="IssRetido" type="tsSimNao" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="ResponsavelRetencao" type="tsResponsavelRetencao" minOccurs="0"
				maxOccurs="1" />
      <xsd:element name="ItemListaServico" type="tsItemListaServico"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="CodigoCnae" type="tsCodigoCnae"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="CodigoTributacaoMunicipio" type="tsCodigoTributacao"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="CodigoNbs" type="tsCodigoNbs"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Discriminacao" type="tsDiscriminacao"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="CodigoPais" type="tsCodigoPaisBacen"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ExigibilidadeISS" type="tsExigibilidadeISS"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="MunicipioIncidencia" type="tsCodigoMunicipioIbge"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="NumeroProcesso" type="tsNumeroProcesso"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="IBSCBS" type="tcIBSCBS"
        minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcDadosConstrucaoCivil">
    <xsd:sequence>
      <xsd:element name="CodigoObra" type="tsCodigoObra"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Art" type="tsArt" minOccurs="1"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcDadosPrestador">
    <xsd:sequence>
      <xsd:element name="IdentificacaoPrestador" type="tcIdentificacaoPrestador"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="RazaoSocial" type="tsRazaoSocial"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="NomeFantasia" type="tsNomeFantasia"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Endereco" type="tcEndereco" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="Contato" type="tcContato" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcInfRps">
    <xsd:sequence>
      <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="DataEmissao" type="xsd:date"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Status" type="tsStatusRps" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="RpsSubstituido" type="tcIdentificacaoRps"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcInfDeclaracaoPrestacaoServico">
    <xsd:sequence>
      <xsd:element name="Rps" type="tcInfRps"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Competencia" type="xsd:date"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Servico" type="tcDadosServico"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Tomador" type="tcDadosTomador"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="Intermediario" type="tcDadosIntermediario"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ConstrucaoCivil" type="tcDadosConstrucaoCivil"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="RegimeEspecialTributacao" type="tsRegimeEspecialTributacao"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="OptanteSimplesNacional" type="tsSimNao"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="IncentivoFiscal" type="tsSimNao"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcDeclaracaoPrestacaoServico">
    <xsd:sequence>
      <xsd:element name="InfDeclaracaoPrestacaoServico" type="tcInfDeclaracaoPrestacaoServico" minOccurs="1"
				maxOccurs="1" />
      <xsd:element ref="dsig:Signature" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcIdentificacaoNfse">
    <xsd:sequence>
      <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="CodigoMunicipio" type="tsCodigoMunicipioIbge"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcInfNfse">
    <xsd:sequence>
      <xsd:element name="Numero" type="tsNumeroNfse" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="CodigoVerificacao" type="tsCodigoVerificacao"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="DataEmissao" type="xsd:dateTime"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="NfseSubstituida" type="tsNumeroNfse"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="OutrasInformacoes" type="tsOutrasInformacoes"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="ValoresNfse" type="tcValoresNfse"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="ValorCredito" type="tsValor"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="PrestadorServico" type="tcDadosPrestador"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="OrgaoGerador" type="tcIdentificacaoOrgaoGerador"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="DeclaracaoPrestacaoServico" type="tcDeclaracaoPrestacaoServico" minOccurs="1" maxOccurs="1" />
      <xsd:element name="ChaveADN" type="tsChaveADN" minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcNfse">
    <xsd:sequence>
      <xsd:element name="InfNfse" type="tcInfNfse" minOccurs="1"
				maxOccurs="1" />
      <xsd:element ref="dsig:Signature" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="versao" type="tsVersao" use="required" />
  </xsd:complexType>

  <xsd:complexType name="tcInfPedidoCancelamento">
    <xsd:sequence>
      <xsd:element name="IdentificacaoNfse" type="tcIdentificacaoNfse"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="CodigoCancelamento" type="tsCodigoCancelamentoNfse"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcPedidoCancelamento">
    <xsd:sequence>
      <xsd:element name="InfPedidoCancelamento" type="tcInfPedidoCancelamento"
				minOccurs="1" maxOccurs="1" />
      <xsd:element ref="dsig:Signature" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcConfirmacaoCancelamento">
    <xsd:sequence>
      <xsd:element name="Pedido" type="tcPedidoCancelamento"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="DataHora" type="xsd:dateTime"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcCancelamentoNfse">
    <xsd:sequence>
      <xsd:element name="Confirmacao" type="tcConfirmacaoCancelamento"
				minOccurs="1" maxOccurs="1" />
      <xsd:element ref="dsig:Signature" minOccurs="0"
				maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="versao" type="tsVersao" use="required" />
  </xsd:complexType>

  <xsd:complexType name="tcRetCancelamento">
    <xsd:sequence>
      <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse" minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>



  <xsd:complexType name="tcInfSubstituicaoNfse">
    <xsd:sequence>
      <xsd:element name="NfseSubstituidora" type="tsNumeroNfse"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
  </xsd:complexType>

  <xsd:complexType name="tcSubstituicaoNfse">
    <xsd:sequence>
      <xsd:element name="SubstituicaoNfse" type="tcInfSubstituicaoNfse"
				minOccurs="1" maxOccurs="1" />
      <xsd:element ref="dsig:Signature" minOccurs="0"
				maxOccurs="2" />
    </xsd:sequence>
    <xsd:attribute name="versao" type="tsVersao" use="required" />
  </xsd:complexType>

  <xsd:complexType name="tcCompNfse">
    <xsd:sequence>
      <xsd:element name="Nfse" type="tcNfse" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="NfseCancelamento" type="tcCancelamentoNfse"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="NfseSubstituicao" type="tcSubstituicaoNfse"
				minOccurs="0" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcMensagemRetorno">
    <xsd:sequence>
      <xsd:element name="Codigo" type="tsCodigoMensagemAlerta"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Correcao" type="tsDescricaoMensagemAlerta"
				minOccurs="0" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcMensagemRetornoLote">
    <xsd:sequence>
      <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Codigo" type="tsCodigoMensagemAlerta"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="Mensagem" type="tsDescricaoMensagemAlerta"
				minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcLoteRps">
    <xsd:sequence>
      <xsd:element name="NumeroLote" type="tsNumeroLote"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="CpfCnpj" type="tcCpfCnpj" minOccurs="1"
				maxOccurs="1" />
      <xsd:element name="InscricaoMunicipal" type="tsInscricaoMunicipal"
				minOccurs="0" maxOccurs="1" />
      <xsd:element name="QuantidadeRps" type="tsQuantidadeRps"
				minOccurs="1" maxOccurs="1" />
      <xsd:element name="ListaRps" minOccurs="1" maxOccurs="1">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="Rps" type="tcDeclaracaoPrestacaoServico"
							minOccurs="1" maxOccurs="unbounded" >
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute name="Id" type="tsIdTag" />
    <xsd:attribute name="versao" type="tsVersao" use="required" />
  </xsd:complexType>

  <xsd:complexType name="tcIBSCBS">
    <xsd:sequence>
      <xsd:element name="OperacaoUsoConsumoPessoal" type="tsIndFinal">
        <xsd:annotation>
          <xsd:documentation>
            Indica opera  o de uso ou consumo pessoal (art. 57)
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="Operacao" type="tsCodIndOp">
        <xsd:annotation>
          <xsd:documentation>
            C digo indicador da opera  o de fornecimento, conforme tabela "c digo indicador de opera  o"
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ValoresTributos" type="tcValoresTributosIBSCBS">
        <xsd:annotation>
          <xsd:documentation>
            Grupo de informa  es relativas aos valores do servi o prestado para IBS e CBS
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="tcValoresTributosIBSCBS">
    <xsd:sequence>
      <xsd:element name="SituacaoTributaria" type="tsCodSitTrib">
        <xsd:annotation>
          <xsd:documentation>
            C digo de Situa  o Tribut ria do IBS e da CBS
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="ClassificacaoTributaria" type="tsCodClassTrib">
        <xsd:annotation>
          <xsd:documentation>
            C digo de Classifica  o Tribut ria do IBS e da CBS
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:element name="ListaMensagemRetornoLote">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="MensagemRetorno" type="tcMensagemRetornoLote"
					minOccurs="1" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ListaMensagemRetorno">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="MensagemRetorno" type="tcMensagemRetorno"
					minOccurs="1" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ListaMensagemAlertaRetorno">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="MensagemRetorno" type="tcMensagemRetorno"
					minOccurs="1" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="cabecalho">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="versaoDados" type="tsVersao"
					minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
      <xsd:attribute name="versao" type="tsVersao" use="required" />
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="CompNfse" type="tcCompNfse" />

  <xsd:element name="EnviarLoteRpsEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="LoteRps" type="tcLoteRps" />
        <xsd:element ref="dsig:Signature" minOccurs="0"
					maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="EnviarLoteRpsResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:sequence>
          <xsd:element name="NumeroLote" type="tsNumeroLote"
						minOccurs="1" maxOccurs="1" />
          <xsd:element name="DataRecebimento" type="xsd:dateTime"
						minOccurs="1" maxOccurs="1" />
          <xsd:element name="Protocolo" type="tsNumeroProtocolo"
						minOccurs="1" maxOccurs="1" />
        </xsd:sequence>
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
					maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="EnviarLoteRpsSincronoEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="LoteRps" type="tcLoteRps" />
        <xsd:element ref="dsig:Signature" minOccurs="0"
					maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>

  </xsd:element>

  <xsd:element name="EnviarLoteRpsSincronoResposta">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="NumeroLote" type="tsNumeroLote"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="DataRecebimento" type="xsd:dateTime"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Protocolo" type="tsNumeroProtocolo"
					minOccurs="0" maxOccurs="1" />
        <xsd:choice>
          <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="CompNfse"
									minOccurs="1" maxOccurs="unbounded" />
                <xsd:element ref="ListaMensagemAlertaRetorno" minOccurs="0" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
						maxOccurs="1" />
          <xsd:element ref="ListaMensagemRetornoLote" minOccurs="1"
						maxOccurs="1" />
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="GerarNfseEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Rps" type="tcDeclaracaoPrestacaoServico"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="GerarNfseResposta">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:choice>
          <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="CompNfse"
									minOccurs="1" maxOccurs="1" />
                <xsd:element ref="ListaMensagemAlertaRetorno" minOccurs="0" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
						maxOccurs="1" />
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="CancelarNfseEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Pedido" type="tcPedidoCancelamento" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="CancelarNfseResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element name="RetCancelamento" type="tcRetCancelamento" minOccurs="1" maxOccurs="1" />
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="SubstituirNfseEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="SubstituicaoNfse" minOccurs="1"
					maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Pedido" type="tcPedidoCancelamento" />
              <xsd:element name="Rps" type="tcDeclaracaoPrestacaoServico" />
            </xsd:sequence>
            <xsd:attribute name="Id" type="tsIdTag" />
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="dsig:Signature" minOccurs="0"
					maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="SubstituirNfseResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element name="RetSubstituicao">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="NfseSubstituida">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element ref="CompNfse" maxOccurs="1"
                      minOccurs="1" />
                    <xsd:element ref="ListaMensagemAlertaRetorno" minOccurs="0" maxOccurs="1" />
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="NfseSubstituidora">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element ref="CompNfse" maxOccurs="1"
                      minOccurs="1" />
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1" maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarLoteRpsEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
					minOccurs="1" maxOccurs="1" />
        <xsd:element name="Protocolo" type="tsNumeroProtocolo"
					minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarLoteRpsResposta">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Situacao" type="tsSituacaoLoteRps" minOccurs="1" maxOccurs="1" />
        <xsd:choice>
          <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="CompNfse" maxOccurs="50"
                  minOccurs="1" />
                <xsd:element ref="ListaMensagemAlertaRetorno" minOccurs="0" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
            maxOccurs="1" />
          <xsd:element ref="ListaMensagemRetornoLote" minOccurs="1"
            maxOccurs="1" />
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseRpsEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="IdentificacaoRps" type="tcIdentificacaoRps"
					minOccurs="1" maxOccurs="1" />
        <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
					minOccurs="1" maxOccurs="1" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseRpsResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element ref="CompNfse" minOccurs="1" maxOccurs="1" />
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
					maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseServicoPrestadoEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
					minOccurs="1" maxOccurs="1" />
        <xsd:element name="NumeroNfse" type="tsNumeroNfse"
					minOccurs="0" maxOccurs="1" />
        <xsd:choice>
          <xsd:element name="PeriodoEmissao" minOccurs="0"
						maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="DataInicial" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
                <xsd:element name="DataFinal" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="PeriodoCompetencia" minOccurs="0"
						maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="DataInicial" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
                <xsd:element name="DataFinal" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
        <xsd:element name="Tomador" type="tcIdentificacaoTomador"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Intermediario" type="tcIdentificacaoIntermediario"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Pagina" type="tsPagina" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseServicoPrestadoResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element ref="CompNfse" minOccurs="1" maxOccurs="50"/>
              <xsd:element name="ProximaPagina" type="tsPagina" minOccurs="0" maxOccurs="1" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
					maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseServicoTomadoEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Consulente" type="tcIdentificacaoConsulente"
					minOccurs="1" maxOccurs="1" />
        <xsd:element name="NumeroNfse" type="tsNumeroNfse"
					minOccurs="0" maxOccurs="1" />
        <xsd:choice>
          <xsd:element name="PeriodoEmissao" minOccurs="0"
						maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="DataInicial" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
                <xsd:element name="DataFinal" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="PeriodoCompetencia" minOccurs="0"
						maxOccurs="1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="DataInicial" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
                <xsd:element name="DataFinal" type="xsd:date"
									minOccurs="1" maxOccurs="1" />
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
        <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Tomador" type="tcIdentificacaoTomador"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Intermediario" type="tcIdentificacaoIntermediario"
					minOccurs="0" maxOccurs="1" />
        <xsd:element name="Pagina" type="tsPagina" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseServicoTomadoResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element ref="CompNfse" minOccurs="1" maxOccurs="50"/>
              <xsd:element name="ProximaPagina" type="tsPagina" minOccurs="0" maxOccurs="1" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
					maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseFaixaEnvio">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Prestador" type="tcIdentificacaoPrestador"
					minOccurs="1" maxOccurs="1" />
        <xsd:element name="Faixa" minOccurs="1" maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="NumeroNfseInicial" type="tsNumeroNfse"
								minOccurs="1" maxOccurs="1" />
              <xsd:element name="NumeroNfseFinal" type="tsNumeroNfse"
								minOccurs="0" maxOccurs="1" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element name="Pagina" type="tsPagina" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="ConsultarNfseFaixaResposta">
    <xsd:complexType>
      <xsd:choice>
        <xsd:element name="ListaNfse" minOccurs="1" maxOccurs="1">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element ref="CompNfse" minOccurs="1" maxOccurs="50"/>
              <xsd:element name="ProximaPagina" type="tsPagina" minOccurs="0" maxOccurs="1" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
        <xsd:element ref="ListaMensagemRetorno" minOccurs="1"
					maxOccurs="1" />
      </xsd:choice>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

