As @CamBruce suggested, the problem is that your xml file has encoded characters where they shouldn't. Ideal solution is to fix the program that generate xml file. Anyway if you, for some reason expect a work-around here, this way will do :
.....
case "embeddedHTML":
var element = XElement.Parse("<embeddedHtml>" +
setting.Value +
"</embeddedHtml>");
counterViewHtml = element.Value;
break;
.....
The codes above tell the program to create new XElement (which is variable element
) by parsing string that already unescaped. Hence, value of newly created XElement will contains string that you want :
<html><body><div>Hello World</div></body></html>