This seems to be a quirk that creeps in between me writing the manuscript in OpenOffice and the staff at Manning opening it in Word, when the chapter is properly typeset it shouldn't be a problem.

HTML5 allows both XML and HTML serialisations. If you serve your pages with the application/xhtml+xml MIME type then you can use the XML serialisation, but then your markup has to conform to more strict rules, one of which is that all attributes need to have quoted values, so then that code would look something like this:

As it is, I've used the more forgiving HTML serialisation throughout so far which allows stand alone attributes, which I've take advantage of, as well as other stuff like mixed case tag names and unquoted values, which I've chosen to avoid (for consistency).