XHTML is HTML in XML, most tags and attributes are the same as of those in HTML. This Article will explain the difference, as well as briefly cover some benefits of using XHTML.
XHTML is not any Cleaner then a properly coded HTML page, XHTML dose not promote use of standards anymore then HTML dose.
Anyone can hold a tool, but that doesn't mean they know how to use it. Saying that XHTML is cleaner is a good sign you don't know how to use it. Yes there are many invalid HTML pages, but this doesn't mean every HTML page is invalid.
Not a Replacement
XHTML is not a replacement of HTML, and HTML will continue to be supported for a long time.
XHTML in SEO
Using XHTML will not effect your placement in the search engines, other Code Related practices however might.
There is a few code-related differences, mainly empty elements needs to be closed, in addition elements and attributes must be in lowercase, and attribute values must be quoted. See also: An Introduction to XHTML
Empty elements are elements which doesn't require a closing tag, paragraphs used to be empty in earlier versions, but in later versions they require a closing tag. So empty elements would define elements such as:
As mentioned elements must be closed in XHTML, this is done by adding a forward slash to the element, like done below.
The Document Type Definition should however not include this slash.
Document Type Definitions
The DTDs of XHTML
The Strict Doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
The Transitional Doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The Frameset Doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Its also important to include the xmlns attribute on the root element, this should link to the namespace.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
The xml namespace is used to qualify elements and attributes in XHTML.
In addition, xhtml compatible with HTML4 may be served with the text/html mime type, it should however be served as application/xhtml+xml. Future versions are expected to require the application/xhtml+xml mime type.