Function to validate Html Fragment

My code generate some dynamic HTML fragments and I want to know does the html valid.

Thanks to HtmlAgilityPack it is easy:

 Debug.Assert(IsValidHtmlFragment(pricesTable));      

public static bool IsValidHtmlFragment(string html)

       {

           HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();

                  doc.LoadHtml(html);

               return (doc.ParseErrors.Count==0);

      }