Fix to handle XHTML correctly