See the question and my original answer on StackOverflow

Maybe a bit late :-) Suppose I have this test.htm Html file:

<html>
<head>
    <title>Hello World!</title>
</head>
<body>
    Hello World
</body>
</html>

Here is how to add a LINK element underneath the HEAD element. You will not the semantics is very close to the System.Xml one, on purpose:

HtmlDocument doc = new HtmlDocument();
doc.Load("test.htm");

HtmlNode head = doc.DocumentNode.SelectSingleNode("/html/head");

HtmlNode link = doc.CreateElement("link");
head.AppendChild(link);
link.SetAttributeValue("rel", "shortcut icon");
link.SetAttributeValue("href", "http://www.mysite.com/favicon.ico");

The result will be:

<html>
<head>
    <title>Hello World!</title>
<link rel="shortcut icon" href="http://www.mysite.com/favicon.ico"></head>
<body>
    Hello World
</body>
</html>