I have gone through a lot of answers for this but was not able to solve issue so asking.
I am getting my xml in a string. It consist of "< 6" as content in some node values.
As a result I am getting an exception
Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 3270, position 54.
Here is the code:
string patternToReplaceAnd = "&(?![a-z#]+;)";
Regex reg = new Regex(patternToReplaceAnd);
xml = reg.Replace(xml, "&");
XDocument xDoc = XDocument.Parse(xml);
Can anyone help me out?