You know what's really a bummer and no XML will help you prevent? If you have an anchor within a header, say
Code:
<h2><a name""></a>whatever</h2>
this will give a bad mistake in mobi files.
What happens? Well the link jumps right to the anchor, ignoring the header tag and displaying the "whatever" as simple text without formatting. Took me a while to figure that one out.