// @nuget: HtmlAgilityPack
using System;
using HtmlAgilityPack;
public class Program
{
public static void Main()
var html =
@"<html>
<head>
<title />
</head>
<body>
<p>
Hello World!
</p>
</body>
</html>";
HtmlNode.ElementsFlags["title"] = HtmlElementFlag.Closed;
var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
string name = htmlDoc.DocumentNode.InnerHtml;
Console.WriteLine(name);
}