var sb = new StringBuilder("<html>\r\t<body>\r\t\t<select>\r"); sb.AppendLine("\t\t\t<option value =\"foobar\" selected=\"selected\">FooBar</option>"); sb.AppendLine("\t\t\t<option value =\"foo\">foo</option>"); sb.AppendLine("\t\t\t<option value =\"bar\">bar</option>"); sb.AppendLine("\t\t</select>\r\t</body>\r</html>");var htmlDoc = new HtmlDocument(); htmlDoc.LoadHtml(sb.ToString());var sb2 = new StringBuilder();var sw = new StringWriter(sb2); htmlDoc.Save(sw); Assert.AreEqual(sb.ToString(), sb2.ToString());here is the input:this is the output:<html><body><select><optionvalue="foobar"selected="selected">FooBar</option><optionvalue="foo">foo</option><optionvalue="bar">bar</option></select></body></html><html><body><select><optionvalue="foobar"selected="selected">FooBar<optionvalue="foo">foo<optionvalue="bar">bar</select></body></html>