See the question and my original answer on StackOverflow

XPATH is much more consise than all this XLinq jargon, IMHO... Here is how to do it:

    HtmlDocument doc = new HtmlDocument();

    foreach (HtmlNode img in doc.DocumentNode.SelectNodes("//img[@src and @height and @width]"))
        img.SetAttributeValue("src", "" + img.GetAttributeValue("src", null));

This code searches for img tags that have src, height and width attributes. Then, it replaces the src attribute value.