HTML uses a ton of SGML features not part of XML (sometimes erroneously though to be non-standard ‘tag soup’, not to mention self-closing tags). You need either a specialized parser or an SGML processor + DTD.
(rip XHTML)
In reality, HTML4 was never implemented to the letter by user agents, because people do things like putting -- inside comments.