I\'m having problems reading the ampersand symbol from an XML file:
XElement xmlElements = XElement.Load(Path_Xml_Data_File);
I get error when
I'm afraid that you're dealing with malformed XML.
To represent the ampersand, the data that you're loading should use the "&" entity.
The ç (ç) and ã (ã) named entities are not part of the XML standard, they are more commonly found in HTML (although they can be added to XML by the use of a DTD).
You could use HtmlTidy to tidy up the data first, or you could write something to convert the bare ampersands into entities on the incoming files.
For example:
public string CleanUpData(string data)
{
var r = new Regex(@"&\s");
string output = r.Replace(data, "& ");
output = output.Replace("ç", "ç");
output = output.Replace("ã", "ã");
return output;
}