Remove the node from parent while keeping the grand children
foreach (var Node in Nodes)
{
Node.ParentNode.RemoveChild(Node, true); //<-- keepGrandChildren
}
var newhtml = htmlDocument.DocumentNode.OuterHtml;
output:
asdf
<h5 align="left">Table
of Contents<br></h5>