def METHOD_NAME(invoice: Invoice) -> XMLDict:
    sender: Sender = invoice.sender
    address: Address = sender.address
    client_address: Address = invoice.recipient_address
    is_italian = client_address.country_code.lower() == "it"
    is_business = invoice.is_business
    recipient_data = {}
    recipient_data["IdFiscaleIVA"] = {
        "IdPaese": invoice.recipient_address.country_code,
        "IdCodice": invoice.recipient_tax_code.lower().replace("it", ""),
    }
    if is_business:
        recipient_data["Anagrafica"] = {"Denominazione": invoice.recipient_denomination}
    else:  # pragma: no cover
        if is_italian:
            recipient_data["CodiceFiscale"] = invoice.recipient_tax_code.upper()
            del recipient_data["IdFiscaleIVA"]
        recipient_data["Anagrafica"] = {
            "Nome": invoice.recipient_first_name,
            "Cognome": invoice.recipient_last_name or "Mancante",
        }
    header: XMLDict = {
        "FatturaElettronicaHeader": {
            "DatiTrasmissione": {
                "IdTrasmittente": {
                    "IdPaese": sender.country_code,
                    "IdCodice": sender.code,
                },
                "ProgressivoInvio": 1,
                "FormatoTrasmissione": invoice.transmission_format,
                "CodiceDestinatario": _get_recipient_code(invoice),
                "PecDestinatario": invoice.recipient_pec,
            },
            "CedentePrestatore": {
                "DatiAnagrafici": {
                    "IdFiscaleIVA": {
                        "IdPaese": sender.country_code,
                        "IdCodice": sender.code,
                    },
                    "Anagrafica": {"Denominazione": sender.company_name},
                    "RegimeFiscale": sender.tax_regime,
                },
                "Sede": {
                    "Indirizzo": address.address,
                    "CAP": address.postcode,
                    "Comune": address.city,
                    "Provincia": address.province,
                    "Nazione": address.country_code,
                },
            },
            "CessionarioCommittente": {
                "DatiAnagrafici": recipient_data,
                "Sede": {
                    "Indirizzo": client_address.address[:60],
                    "CAP": ("00000" if not is_italian else client_address.postcode),
                    "Comune": client_address.city,
                    "Provincia": client_address.province,
                    "Nazione": client_address.country_code,
                },
            },
        }
    }
    return header