Can I use Html Agility Pack to make the output look nicely indented, unnecessary white space stripped?
A variation of this question has been answered recently
Basically the outcome of this was that while you can use HtmlAgilityPack to clean it up a bit by using the fix nested tags.
The best solution is to use something called Tidy which is an application that was originally created by some developers at w3c and then made open source. Its the engine that powers the w3c validator as well.
This article covers how to use it but you had to sign up (free) to view it:
It seems like a legit article but its funny because nobody else seems to have covered this topic in the last six years...