toXml method
Converts the individual party's details into XML format.
This XML structure includes the name, tax ID, address, and legal entity information for an individual party. The XML elements generated are:
- Postal address with street name.
- Party tax scheme with the company ID (tax ID) and VAT scheme.
- Party legal entity with the registration name (party name).
Implementation
@override
void toXml(XmlBuilder builder) {
builder.element('cac:Party', nest: () {
builder.element('cac:PostalAddress', nest: () {
builder.element('cbc:StreetName', nest: address);
});
builder.element('cac:PartyTaxScheme', nest: () {
builder.element('cbc:CompanyID', nest: taxId);
builder.element('cac:TaxScheme', nest: () {
builder.element('cbc:ID', nest: 'VAT');
});
});
builder.element('cac:PartyLegalEntity', nest: () {
builder.element('cbc:RegistrationName', nest: name);
});
});
}