SCHEMA-001
XML Not Well-Formed
What This Error Means
The submitted file cannot be parsed as XML. Common causes are: unclosed tags, missing root element, invalid characters (e.g. unescaped & or <), invalid encoding declaration, or a BOM (Byte Order Mark) in a non-UTF-8 encoding. The KOSIT validator rejects the document before any Schematron rules are checked.
Why this happens
SCHEMA-001 means the file is not well-formed XML — the parser cannot even build a document tree, so no business rules are evaluated. The most common causes are: an unescaped ampersand or angle bracket in a text value (e.g. 'Meyer & Sohn' instead of 'Meyer & Sohn'), a tag that is opened but never closed, mismatched tag nesting, an XML declaration that does not match the actual encoding, or a Byte Order Mark (BOM) emitted by an editor saving as UTF-8-with-BOM or UTF-16. Concatenating two XML fragments or accidentally prepending log output also breaks well-formedness.
How to Fix It
Open the file in an XML editor (e.g. XMLSpy, oXygen, or VS Code with the XML extension) and resolve all syntax errors. Ensure the file is saved as UTF-8 without BOM. Escape special characters: & → & < → < > → > " → "
Step-by-step
1) Open the file in an XML-aware editor (oXygen, XMLSpy, or VS Code with the XML extension) which will point to the exact line and column of the first error. 2) Escape special characters in all text values: & → &, < → <, > → >, " → " (in attributes). 3) Save as UTF-8 without BOM; confirm the declaration <?xml version="1.0" encoding="UTF-8"?> matches the real encoding. 4) Check that every opening tag has a matching, correctly nested closing tag. 5) Ensure no stray text precedes the XML declaration. 6) Re-parse; only once it is well-formed will schema and Schematron checks run.
Fix Automatically
Upload your invoice to our Smart Repair engine. It will detect and fix SCHEMA-001 errors automatically with a GoBD audit trail.
Open Smart RepairFrequently asked questions
Why does a company name with '&' break the XML?
Because '&' starts an XML entity. A literal ampersand in text must be written as &. So 'Meyer & Sohn' must become 'Meyer & Sohn'. The same applies to < and >.
What is a BOM and why is it a problem?
A Byte Order Mark is an invisible marker some editors add at the start of a file. In XRechnung processing it can make the file unparseable. Save as UTF-8 without BOM.
Related Errors
Other commonly encountered validation errors