Pixel Pete saysConverting HTML to XHTML is mechanical: lowercase, close, quote, nest, escape, add namespace.
The migration recipe: lowercase all tags/attributes, close every element (self-close voids), quote all values, fix nesting, escape stray &/<, expand boolean attributes, and add the doctype + xmlns. Tools like HTML Tidy automate most of it. Then serve as application/xhtml+xml to actually get XML parsing.
Power-ups you unlock
Lowercase · close · quote · nest · escape
Expand booleans; add doctype + xmlns
HTML Tidy automates the grunt work
Serve as application/xhtml+xml to enforce it
Quirks Mode attacks — common mistakes
Forgetting to escape raw & in text/URLs
Converting markup but leaving the MIME type as text/html
Hand-converting large sites instead of tooling
Boss battleList the conversion steps in order for one messy HTML snippet.