I can easily remove the element just by note.Remove() lik this:
HtmlDocument html = new HtmlDocument(); html.Load(Server.MapPath(@\"~\\Site\\themes\\default
How about this?
var removedNodes = document.SelectNodes("//removeme"); if(removedNodes != null) foreach(var rn in removedNodes){ HtmlTextNode innernodes =document.CreateTextNode(rn.InnerHtml); rn.ParnetNode.ReplaceChild(innernodes, rn); }