try
{
string _strline = "<ul>This is ul</ul><li>This is li</li><b>This is bold</b>";
string append = "xmlns=" + "\" http://www.w3.org/1999/xhtml\"";
string result = string.Empty;
var arr = Regex.Matches(_strline, @"<[A-Za-z-']+>").Cast<Match>().Select(m => m.Value).ToArray();
var openTags = arr.Distinct().ToArray();
result = _strline;
for (int i = 0; i < openTags.Length; i++)
{
var temp = openTags[i].Replace(">", " " + append + " >");
result = result.Replace(openTags[i], temp);
}
Console.WriteLine(_strline);
Console.WriteLine(result);
Console.ReadKey();
}
catch (Exception ex)
{
throw ex;
}