Firstly, I am sorry - I have searched and searched, tried example after example, answer after answer and after trying lots of different examples, I still cannot get this to work for myself.
I have an XML smoething like this:
<?xml version="1.0" encoding="utf-8"?>
<Backup LastRun="Saturday, May 16, 2020 7:58:53 PM">
<MyVehicleElements>
<InVehicle>true</InVehicle>
... etc ...
</MyVehicleElements>
</Backup>
And I my code, fails returning a null exception as I cannot for the life of me work out how to read the extra level.
XElement xelement = XElement.Load("PathTo\\File.xml");
IEnumerable<XElement> Backup = xelement.Elements();
foreach (var MyVehicleElements in Backup)
{
Game.DisplayNotification(MyVehicleElements.Element("InVehicle").Value);
// Should return text "true"
}
Please can somebody help me before my head explodes. Thank you in advance.