Fix problems with xhtml parsing