Suppose we have this code:
string actualvalue = "<a>";
string abc = "<firstnode><secondnode abc=\""+ actualvalue + "\"></secondnode></firstnode>";
XElement item2 = XElement.Parse(abc);
foreach (var item in item2.Descendants("secondnode"))
{
string aftergettingitfromXlement = item.Attribute("abc").Value;
///so aftergettingitfromXlement = "<a>" which is not correct i want to have actual value which is encoded
}
Any idea how can I get the actual value, I don't want to encode again. Why is the encoding lost?