How to Fix KoSIT Error PEPPOL-EN16931-R008: Empty XML Elements Forbidden in XRechnung 3.0
KoSIIT 1.6.3 rejects invoices with empty XML elements like <ram:LineTwo></ram:LineTwo>. This rule applies to all elements, not just specific BT/BG fields. Remove or omit empty elements to fix the error.
1. Why KoSIT Validator v1.6.3 Rejects This Invoice
EN 16931 mandates that XML documents must not contain empty elements. The XPath test in CII and UBL profiles identifies any element with no child nodes and no non-whitespace text content. This includes optional fields like <ram:LineTwo> when left blank. The rule is enforced to ensure data integrity and interoperability across the PEPPOL network.
//*[not(name() = 'ram:ApplicableHeaderTradeDelivery') and not(*) and not(normalize-space())]false()//*[not(*) and not(normalize-space())]2. KoSIT-Verified XML Example: Broken vs. Fixed
<ram:PostalTradeAddress>
<ram:PostcodeCode>10117</ram:PostcodeCode>
<ram:LineOne>Klinikstraße 1</ram:LineOne>
<ram:LineTwo></ram:LineTwo>
<ram:CityName>Berlin</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:PostalTradeAddress>
<ram:PostcodeCode>10117</ram:PostcodeCode>
<ram:LineOne>Klinikstraße 1</ram:LineOne>
<ram:CityName>Berlin</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
The broken XML snippet fails because <ram:LineTwo></ram:LineTwo> is an empty element. The fixed version removes this element entirely, ensuring the XML conforms to EN 16931 and passes KoSIT 1.6.3 validation without errors.
3. Step-by-Step Fix Checklist
- Step 1: Inspect the exact element/field
- Step 2: Apply the EN 16931 / XRechnung correction
- Step 3: Re-validate with Beleq's free KoSIT v1.6.3 validator
4. Common Shopify Store & DATEV Workflow Trigger
In Shopify B2B stores, empty address fields like customer address2 or company name can result in empty XML tags when generating XRechnung 3.0 invoices. These are rejected by DATEV and KoSIT. Beleq's validator helps identify and fix these issues by flagging empty elements before sending the invoice to the recipient.
5. Frequently Asked Questions
What is the difference between PEPPOL-EN16931-R008 and ZUGFeRD validation?
PEPPOL-EN16931-R008 is specific to XRechnung 3.0 and CII-based invoices. ZUGFeRD 2.3 (Factur-X) uses a similar but not identical validation schema. Always validate against the correct standard for your use case.
Can I use a placeholder like <ram:LineTwo>N/A</ram:LineTwo> instead of removing the element?
No, EN 16931 explicitly forbids empty elements, but also discourages using placeholders like 'N/A'. The correct fix is to omit the element entirely if the data is not present.
Related KoSIT Error Codes
Check your hybrid ZUGFeRD PDF or XRechnung XML in under 1 second against the official German KoSIT Validator v1.6.3 — 100% RAM-based on Frankfurt servers with zero retention and no registration.
Open Free KoSIT v1.6.3 Validator → See Beleq for Shopify