Suppose you have the following HTML:
<style><input><div name="myDiv"></div></style>
You want to load it into a PHP DOMDocument object, how should you do it? If you use $doc->loadHTML() it will have the problem that the <div> is inside the <style> tag. If you use $doc->loadXML() it will have the problem that the <input> tag doesn't close.
Note: I can't edit the HTML, only the PHP used to parse it, because I'm scraping here.