I can easily remove the element just by note.Remove() lik this:
HtmlDocument html = new HtmlDocument();
html.Load(Server.MapPath(@\"~\\Site\\themes\\default
Perhaps this might be what you're looking for?
foreach (HtmlNode node in html.DocumentNode.SelectNodes("//removeme"))
{
HtmlNodeCollection children = node.ChildNodes; //get 's children
HtmlNode parent = node.ParentNode; //get 's parent
node.Remove(); //remove
parent.AppendChildren(children); //append the children to the parent
}
Edit: L.B's answer is much cleaner. Go with his!