When I am trying to parse a string value which has a huge text, then I am getting system out of memory exception.
I am using below code.
foreach (KeyValuePair<string, object> item in newXMlValue) { XElement node = (from c in orderXML.Descendants(item.Key) select c).FirstOrDefault(); if (!object.Equals(node, null)) {
XElement xmlValue = XElement.Parse(item.Value.ToString()); // Here I am getting system out of // memory Exception
node.ReplaceWith(xmlValue); } }