What Is XML Invoicing? A Plain-Language Guide with Examples
An XML invoice is an electronic invoice where every data field is stored in structured, machine-readable tags. Unlike a PDF that is designed for human eyes, an XML invoice is designed for software. It can be read, validated, and processed automatically by any accounting system, ERP, or tax authority. If you have heard the terms "e-invoicing," "UBL," or "Peppol" and wondered what ties them all together, the answer is XML.

In this article
1. What is XML?
XML stands for Extensible Markup Language. It is a text-based format that stores data inside descriptive tags. Each tag tells you what the data means. For example, <InvoiceDate>2026-03-01</InvoiceDate> is immediately clear: this is the invoice date, and its value is March 1, 2026.
XML was designed to be both human-readable and machine-readable. You can open an XML file in any text editor and understand its contents. But the real power is that software can parse and process XML automatically. No OCR, no data entry, no copy-pasting between systems.
XML is platform-independent. It works on Windows, Mac, Linux, in web applications, desktop software, and mobile apps. This universality is exactly why it was chosen as the foundation for European e-invoicing standards.
2. XML vs. PDF vs. EDI
Not all electronic invoices are created equal. There are three main categories of invoice transmission, and understanding the differences matters for compliance and efficiency.
| Method | Format | Machine-readable? | Compliant? |
|---|---|---|---|
| XML invoicing | Structured (UBL, CII) | Yes, fully | Yes |
| EDI invoicing | Structured (EDIFACT, ANSI X12) | Yes, fully | Depends on country |
| PDF invoicing | Unstructured (visual document) | No (needs OCR) | No |
| Hybrid (ZUGFeRD/Factur-X) | PDF + embedded XML | Yes (via XML layer) | Some countries |
The key distinction is structured vs. unstructured. A PDF looks like an invoice, but to a computer it is just a picture of text. It has no idea which number is the total, which is the VAT, or which is the invoice number. An XML file labels every piece of data explicitly. That is why regulators across Europe require structured formats for B2B e-invoicing.
3. Why businesses use XML invoicing
XML invoicing is not just a regulatory checkbox. It delivers real operational benefits that compound as your invoice volume grows.
Efficient XML processing
Software reads XML invoices instantly. No manual data entry, no OCR errors, no copy-pasting between systems. An invoice that takes 15 minutes to process manually takes milliseconds as XML.
Automatic validation
XML invoices can be validated against schemas and business rules before delivery. Errors like wrong VAT calculations or missing fields are caught immediately, not weeks later.
Security and compliance
XML invoices sent via Peppol are encrypted in transit and delivered through authenticated Access Points. No email interception, no invoice fraud, full audit trail.
Universal compatibility
XML is platform-independent and works with any programming language or operating system. A Belgian company and a German company using completely different software can exchange invoices seamlessly.
The efficiency case
Studies by the European Commission estimate that switching from paper or PDF invoices to structured e-invoicing saves €6 to €8 per invoice. For a company processing 1,000 invoices per month, that is €72,000 to €96,000 per year in reduced processing costs.
4. What an XML invoice looks like (real example)
Here is a simplified e-invoicing sample in UBL XML format. This is the actual structure that gets transmitted over the Peppol network when a Belgian company sends an invoice.
<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<!-- Header: who, what, when -->
<cbc:ID>INV-2026-0042</cbc:ID>
<cbc:IssueDate>2026-03-01</cbc:IssueDate>
<cbc:DueDate>2026-03-31</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<!-- Seller -->
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="0208">0123456789</cbc:EndpointID>
<cac:PartyName>
<cbc:Name>Webbureau Leuven BVBA</cbc:Name>
</cac:PartyName>
<cac:PartyTaxScheme>
<cbc:CompanyID>BE0123456789</cbc:CompanyID>
<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
</cac:PartyTaxScheme>
</cac:Party>
</cac:AccountingSupplierParty>
<!-- Buyer -->
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="0208">0987654321</cbc:EndpointID>
<cac:PartyName>
<cbc:Name>Bakkerij Peeters NV</cbc:Name>
</cac:PartyName>
</cac:Party>
</cac:AccountingCustomerParty>
<!-- Line item -->
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="HUR">40</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">3200.00</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Website redesign</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>21</cbc:Percent>
<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">80.00</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
<!-- Totals -->
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">672.00</cbc:TaxAmount>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:TaxExclusiveAmount currencyID="EUR">3200.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">3872.00</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="EUR">3872.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
</Invoice>Let's break down what makes this efficient XML:
- Every field is labeled. The tag
<cbc:Name>tells software "this is a name." No guessing, no pattern matching. - Data types are explicit. Amounts include a
currencyIDattribute. Quantities include aunitCode. No ambiguity. - Structure is hierarchical. The invoice contains parties, which contain names and tax schemes. Line items contain items, which contain tax categories. This nesting makes relationships clear.
- It is self-describing. You can open this file in a text editor and understand what it says, even without knowing UBL.
For a deeper look at every section of a UBL invoice, read our complete UBL format guide.
5. Common XML invoice formats
Not all XML invoices use the same schema. Several standards exist, each designed for different networks and regions.
UBL 2.1 (Universal Business Language)
The standard used by Peppol and required for Belgian e-invoicing. Maintained by OASIS. Supports invoices, credit notes, purchase orders, and more. This is the format you will encounter most in European B2B e-invoicing.
CII (Cross-Industry Invoice)
Maintained by UN/CEFACT. The other XML syntax accepted by the European EN16931 standard. Used in some French and German implementations. Same data, different tag names.
FatturaPA
Italy's national XML invoice format. Required for all B2B and B2C invoices in Italy since 2019. Italy was the first EU country to mandate e-invoicing nationwide.
ZUGFeRD / Factur-X (hybrid)
A hybrid format that embeds a CII XML file inside a PDF/A-3 document. The PDF provides a human-readable view while the XML carries the structured data. Popular in Germany and France. You can extract and view the embedded XML with our free ZUGFeRD Extractor or view standalone CII XML files with the ZUGFeRD Viewer.
Which format do you need?
If you are sending e-invoices in Belgium or via the Peppol network, the answer is UBL 2.1. Your Peppol Access Point (like e-invoice.be) generates this format for you. You do not need to choose or worry about the XML schema yourself.
6. How XML invoicing works in practice
You do not need to create XML files manually. Here is how the process works for most businesses.
You create an invoice
Use your normal workflow. That could be your accounting software, an Excel template, the e-invoice.be dashboard, or an API call with JSON data.
Your Access Point converts to XML
e-invoice.be takes your invoice data and generates a valid UBL 2.1 XML document. It fills in all required fields, applies the correct namespaces, and structures everything according to Peppol BIS Billing 3.0.
Validation happens automatically
The XML is validated against the UBL schema, EN16931 business rules, and Peppol-specific rules. If anything is wrong, you get a clear error message before the invoice is sent.
Delivery via Peppol
The validated XML invoice is sent securely from your Access Point to the recipient's Access Point over the Peppol network. The recipient's software imports the structured data directly into their accounting system.
The entire process takes seconds. The recipient gets a machine-readable invoice that can be booked automatically. No scanning, no OCR, no manual data entry on either side.
7. Hybrid invoicing: XML inside PDF
Some formats combine the best of both worlds. ZUGFeRD (Germany) and Factur-X (France) are hybrid formats that embed a CII XML file inside a PDF/A-3 document. When you open the file, you see a normal-looking PDF invoice. But inside the PDF, there is a hidden XML attachment with all the structured data. Use our ZUGFeRD XML Extractor to extract and view the embedded XML from any ZUGFeRD or Factur-X PDF.
This approach works well for the transition period: recipients who have modern software can extract and process the XML data automatically. Recipients who don't can still open the PDF and read it like a traditional invoice.
However, hybrid formats are not universally accepted. Belgium and most countries adopting Peppol require pure UBL XML delivered via the Peppol network. A ZUGFeRD PDF sent by email does not meet the Belgian e-invoicing mandate.
8. How to get started
You have two paths depending on your setup.
For businesses
- Create an account on e-invoice.be
- Register your Belgian enterprise number
- Get your Peppol ID (automatic)
- Start receiving XML e-invoices immediately
- Send and receive invoices at €0.25 each (we generate the XML for you)
For developers
- Register and get an API key
- Send invoice data as JSON via the REST API
- We convert to UBL XML and validate automatically
- Receive incoming invoices via webhooks (as JSON)
- Or download the raw UBL XML if you need it
Either way, you never have to write XML yourself. Read our API integration guide for code examples, or check the Peppol registration guide to get started in 10 minutes.
9. Frequently asked questions
What is an XML invoice?
An XML invoice is an electronic invoice encoded in Extensible Markup Language (XML). Unlike a PDF or paper invoice, every data field (invoice number, date, amounts, VAT, line items) is stored in structured, machine-readable tags. This allows accounting software, ERP systems, and tax authorities to process the invoice automatically without manual data entry.
Is XML invoicing the same as e-invoicing?
XML invoicing is one form of e-invoicing, but not all e-invoicing uses XML. E-invoicing refers to any electronic exchange of invoices in a structured format. XML is the most common syntax used in European e-invoicing standards like UBL and CII. PDFs and scanned invoices are not considered true e-invoices because they lack structured data.
What is the difference between a PDF invoice and an XML invoice?
A PDF invoice is a visual document designed for humans to read. An XML invoice is a structured data file designed for machines to process. A PDF requires OCR or manual entry to extract data. An XML invoice can be imported directly into accounting software with zero manual work. Under the Belgian e-invoicing mandate, only structured formats like XML qualify as valid e-invoices.
Do I need technical skills to send XML invoices?
No. Modern e-invoicing platforms like e-invoice.be handle the XML generation for you. You provide invoice data through a simple interface, email, or JSON API, and the platform converts it to a valid XML e-invoice (UBL format) and delivers it via Peppol. You never have to read or write XML yourself.
What XML format does Peppol use?
Peppol uses UBL 2.1 (Universal Business Language) as its XML format. Specifically, Peppol invoices follow the Peppol BIS Billing 3.0 profile, which is compliant with the European standard EN16931. This ensures all Peppol invoices have a consistent structure that any receiving system can process.
Is XML invoicing mandatory in Belgium?
Since January 2026, all Belgian B2B transactions must use structured e-invoicing via Peppol. Peppol uses UBL XML as its document format. So while the law does not specifically mandate XML, it mandates Peppol, which uses XML under the hood. Your e-invoicing provider handles the XML part for you.
Start sending XML e-invoices today
You provide the data. We handle the XML, validation, and Peppol delivery. No technical knowledge required. No subscription. Pay only per invoice.