XHTML

Definition
XHTML, short for Extensible Hypertext Markup Language, is an XML based reformulation of HTML that applies strict, well formed syntax rules. It requires proper nesting, lowercase element names, quoted attributes, and closing tags for all non-void elements. Because it follows XML, XHTML can be parsed by standard XML tools, validated against schemas or DTDs, and integrated into automation pipelines with high reliability.
XHTML emerged to improve consistency across browsers and to enable content reuse across systems. It supports clean separation of structure, style, and behaviour, which helps accessibility and maintainability. Documents may be served as application/xhtml+xml for true XML parsing, or as text/html for legacy compatibility, with careful attention to features that are safe in both modes. Modern practice often uses the XML serialization of HTML5, sometimes called XHTML5, to combine HTML capabilities with XML rigor.
Advanced
XHTML documents declare a DOCTYPE and can use XML namespaces to embed SVG or MathML in the same page. When served as application/xhtml+xml, the browser uses an XML parser that fails fast on well formedness errors, which improves quality but requires precise markup. Scripts and styles must avoid raw characters that break XML, often handled with external files or CDATA sections.
Tooling includes validators, linters, and build steps that transform or assemble content via XSLT or XML pipelines. In mixed ecosystems, polyglot markup patterns allow the same document to work in both HTML and XML modes. Production setups monitor MIME type accuracy, caching, and compression to ensure predictable behaviour across devices.
Why it matters
Use cases
Metrics
Issues
Example
A scientific publisher migrated journal articles to XHTML5 with MathML and SVG charts. All content passed XML validation in the build pipeline and was transformed into multiple formats, including web and ebook. The move reduced production errors, improved accessibility, and shortened release cycles for new issues.