errorubl-2.1

XML-002:Malformed XML structure

XML document is not well-formed.

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

Engine Classification

Financial or legal field · Modification blocked by policy

Reason: The XML document has structural errors (unclosed tags, invalid nesting, etc.) that make it unparseable. Your invoicing software must generate well-formed XML. Contact your software vendor to fix the XML generation.

What is XML-002?

XML-002 is a fatal validation rule defined in the ubl-2.1 specification. It validates the XML parsing error element in the UBL invoice XML.

When this rule fires, the invoice is non-compliant and will be rejected by Peppol access points and national validation services. The sending system receives a rejection response and the invoice does not reach the buyer.

Target path: XML parsing error

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

Why This Error Matters

Malformed XML cannot be processed.

XML-002 is a hard failure. Invoices that trigger this rule are rejected at the access point and never reach the recipient. In Peppol networks, this means your sending system receives an MLR (Message Level Response) with a rejection status. The invoice must be corrected and re-sent, adding delay to your payment cycle.

Validator Behavior

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

How to Fix It

1.

Check brackets

All tags must close properly

2.

Check quotes

Attributes must use quotes

3.

Validate

Use XML validator

XML Example

Generic example based on the rule's target XPath. Your actual XML structure may differ.

Before
<!-- Triggers validation error -->
<XML parsing error></XML parsing error>
After
<!-- Corrected -->
<XML parsing error>VALID_VALUE</XML parsing error>

Technical Reference

XPathXML parsing error
Specubl-2.1

Common Causes

  • ·Unclosed tags
  • ·Missing quotes
  • ·Invalid characters

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

Frequently Asked Questions

XML document is not well-formed.

Fix XML syntax errors. Invoice Navigator can help identify and fix this issue.

Yes, XML-002 is a critical error that must be fixed.

Last updated: 19 January 2026

Share this guide:

Handle XML-002 Automatically in Your Pipeline

The compliance engine auto-remediates this error with controlled safety policies and evidence pack generation.