NFE-520
Rejeição: CFOP de Operação com Exterior e UF destinatário difere de "EX" [nItem: …] (UF …).
In English A CFOP for operations abroad needs a receiver abroad (UF EX).
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
nfe:infNFe/nfe:det
not($c1 = ('3', '7')) or $destUF = 'EX' or $ufCons = 'EX' or not(../nfe:dest/nfe:enderDest)
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol