If contents isn't xhtml, retry as html, and convert.

This will allow legacy ebooks to open, converting the content to
xhtml. Though the change is a few lines, it took a lot of effort to
figure out how to get chrome's XMLSerializer to create actual xml. In
the end, the fix was two lines: Create a new xhtml document, and clone the old
one's contents into it.