XHTML is a stricter form of HTML and as such is a subset of XML which is an extremely useful, powerful and very strict way of marking up pure data.

The headers you sometimes see along with XHTML code declare what exactly the rules are.. for instance, that <a> is an anchor. In XML you can declare your own rules.

XHTML is significantly better than HTML, as it encourages good practice. Where it doesn't allow things that HTML does, it's likely there's a good reason.. for instance not using target="_blank". These things then in turn impact on the sites accessibility, consistency, search engine performance etc etc.

Even if you don't use valid XHTML it's worth validating to Strict where you can.

That said the headers like these are more a declaration of intent, so if you do have a few errors it shouldn't matter.

It may be that you can jump into coding valid XHTML. You might however find it less frustrating starting with sloppy HTML and validating 4.01 Transitional, then 4.01 Strict, then XHTML 1.0 Transitional, then XHTML 1.0 Strict.

XHTML 1.1 is where the rules become much more stringent. This involves <?xml version="1.0" encoding="iso-8859-1"?> and xml+xhtml MIME headers which switch the browsers into strict complient mode and do not allow them to compensate for sloppy coding.. that is the page falls over with errors!

Without these headers XHTML is treated as HTML and browsers will compensate for any errors.

If you are new to validation, I'd suggest getting HTML 4.01 Strict, before worrying about serving up XHTML, but would suggest XHTML is well worth doing if you have time.

Introductions and references for HTML, XHTML, XML and more..

Valid document headers

W3C HTML/XHTML Validator

Correct XHTML mime headers