Format rules
- One root element
- Tags must close
- Attributes quoted
Valid example
<root><item id="1"/></root>
Invalid example
<root><item></root>
Common errors
- Assuming XML accepts syntax from a similar format
- Using the wrong encoding or line ending
- Copying invisible characters from rich text
- Testing only the happy path and not parser errors
Online validation and conversion
Compared with nearby formats
XML should be chosen for the parser and ecosystem that will consume it. Prefer strict formats for APIs, human-friendly formats for ops config, and signed formats only when verification is required.