errorstructureubl-2.1

XML-001:Invoice file is not well-formed XML

Fix: Fix the generator — regenerate from the source system after correcting serializer bugs, encoding mismatches, or unescaped characters.

XML-001 is raised when the invoice file fails XML well-formedness before any schema or Schematron rule can apply. The parser cannot build a DOM tree because the bytes do not conform to XML 1.0 grammar.

Severity
Fatal
Rule set
ubl-2.1
Country
All EU
Fix type
BLOCKED
Confidence
10%

Engine Classification

Financial or legal field · Modification blocked by policy

Reason: A non-well-formed file cannot be auto-repaired without losing or duplicating content. The fix must happen at the generator.

What is XML-001?

XML-001 is a fatal validation rule defined in the ubl-2.1 specification.

When this rule fires, the invoice is rejected by Peppol access points and never reaches the buyer.

This error requires manual correction — financial fields are protected by policy.

Why This Error Matters

Well-formedness is the foundation of every other validation layer. If the file fails here, no EN 16931, Peppol, or country rule can be evaluated.

XML-001 is a hard failure — the invoice must be corrected and re-sent before it can reach the recipient.

Validator Behavior

  • ·Causes invoice rejection
  • ·Fails UBL schema validation
  • ·Error returned: XML-001
  • ·Specification: ubl-2.1

Before / After

Failing XML
<cbc:Note>Customer said: "the box arrived & it was damaged"</cbc:Note>
Corrected XML
<cbc:Note>Customer said: &quot;the box arrived &amp; it was damaged&quot;</cbc:Note>

Technical Reference

Specubl-2.1

Seeing this in production? The API handles XML-001 automatically. See the fix response →

Frequently Asked Questions

Well-formedness failures occur before the XML can be loaded into a DOM, so no schema or Schematron rule can run.

No. A non-well-formed file cannot be reliably repaired without losing or duplicating content. Fix the generator and re-export.

xmllint --noout prints the line and column of the first failure. VS Code, IntelliJ, and oXygen XML Editor also pinpoint the offending byte.

Yes — a file saved as Windows-1252 but declared UTF-8 will fail as soon as a non-ASCII character appears. Always write UTF-8 without BOM and keep the declaration consistent.

Yes. Any character below U+0020 other than tab, line feed, and carriage return is forbidden in XML 1.0 and must be filtered before writing.

Related Content

Last updated: 20 April 2026

Share this guide:

Validate your invoice

Drop your XML here to check for XML-001

Detect XML-001 before submission

This error involves a financial field that can't be auto-modified. We'll flag it with a clear diagnosis so you can fix it at the source.