CFDI40153
Se debe registrar un valor de acuerdo al catálogo c_Pais en el campo ResidenciaFiscal, cuando en el campo NumRegIdTrib se registre información.
In English A foreign receiver (XEXX010101000) with a tax number (NumRegIdTrib) or the Comercio Exterior complement must have its country in ResidenciaFiscal.
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.
/cfdi:Comprobante/cfdi:Receptor
not($foreign and (@NumRegIdTrib or $cce)) or @ResidenciaFiscal
Checked with CFDI 4.0