Cool idea, but I'd worry about all the malformed markup.
The DOM represents the tree structure derived from the markup by the browser, so dealing with malformed markup wouldn't be the problem of this extension, it'd be the problem of the browser it's integrating in to.