The DOCTYPE declaration should always be the first line in an XHTML document
Be aware that newer browsers (like Internet Explorer 6) might treat your document differently depending on the <!DOCTYPE> declaration. If the browser reads a document with a DOCTYPE, it might treat the document as "correct". Malformed XHTML might fall over and display differently than without a DOCTYPE.
XHTML 1.0 specifies three XML document types that correspond to three DTDs: Strict, Transitional, and Frameset.
Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
The character set and xml namespace are also required for proper XHTML pages. Put inside of a meta tag, the character set tells the browser what set of characters it will be receiving. The xml namespace is put in the html tag right below the doctype and it provides a method to avoid element name conflicts.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> ... </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
</head>
<body> ... </body>
</html>