XHTML Formatting – well formed XML
The good thing, and sometimes the bad thing, about xHTML is that it requires strict attention to well-formedness and element and attribute capitalization. Here’s a quick guide that will make it easy for you to remember what to do and what not to do when you’re marking up a document.
Well-formedness
Well-formedness refers to how you nest your elements. Back in HTML 4 you could get away with something like this:
<p>This HTML is <strong>crazy!</p>
<p>It won’t</strong> validate!</p>
But in xHTML it would fail miserably because the strong tags are improperly laid out. In order for your markup to be nested properly your tags cannot overlap.
<p>This HTML is <strong>great!</strong></p>
<p><strong>It will</strong> validate now.</p>
Element and Attribute Capitalization
As a general rule of thumb make sure to type everything in lower case. In XML this is different from This. In other words:
<P>UPPERCASE IS BAD</P>
<p>lowercase is good</p>









