Does anyone know of a tool to validate a page's DOM after manipulation and injection.

The problem is that I have a very complex page with some html injected via js from a CMS (which isn't always neat sadly) also a lot of dom elements being added and removed via the JS UI elements on the page plus a load of other MVC style parts. firebug etc tends to close tags themselves. I suppose I could log out the whole DOM tree and paste it into a validator but I'm looking for something a bit more elegant?

**EDIT:** 

for clarification: I have a project where the DOM is being messed up, but there can be tens, perhaps up to 200 scraps of HTML complied using JS templates (mustache) in an MVC (backbone) pattern, as well as user and CMS input. I'm looking for a handy tool which can snapshot the DOM in any scenario and give me clearer pointers than built into Dev.Tools/ Firebug