# RSC-016: file is not well-formed XML, how to fix it

Source: https://epubcc.com/epubcheck/rsc-016/ (updated 2026-11-04)

EPUBCheck RSC-016 is a fatal error message: “Fatal Error while parsing file: ….” A file is not well-formed XML, so it cannot be parsed at all. EPUB content documents must be valid XML, and reading apps may show an error page or nothing at all for that chapter.

- Official message (EPUBCheck 5.4.0): Fatal Error while parsing file: %1$s
- Default severity: Fatal error

## Typical causes

- An unescaped & in text or in a URL (it must be written &amp;).
- HTML named entities such as &nbsp; that XML does not define.
- Unclosed or mismatched tags, or an attribute without quotes.

## How to fix it

1. Read the text after the colon: EPUBCheck reports the file, the line and column, and the parser's own description of the problem.
2. Escape & as &amp;, replace named entities with numeric ones (&#160; for a non-breaking space), and close every tag.
3. Validate again: once the file parses, schema errors (RSC-005) may appear that were hidden before.

## When it's not this

If the XML parses but an element or attribute is not allowed, the error is RSC-005.

## Sources

- EPUB 3.3, §3.9 XML conformance: https://www.w3.org/TR/epub-33/#sec-xml-constraints (read 2026-11-04)

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EpubCC.
