Can someone explain to me how this works
I dont understand how this line works:
XElement elemento = docxml.Descendants("Cliente").FirstOrDefault(x => Convert.ToInt32(x.Element("DNI").Value) == cliente.dni);
This is how the xml file looks like:
public bool EliminarClienteXML(BE_Cliente cliente)
{
acceso = new DatosXML();
XDocument docxml = acceso.LeerXML("Clientes.xml");
XElement elemento = docxml.Descendants("Cliente").FirstOrDefault(x => Convert.ToInt32(x.Element("DNI").Value) == cliente.dni);
elemento.Remove();
docxml.Save("Clientes.xml");
return true;
}<?xml version="1.0" encoding="utf-8"?>
<Clientes>
<Cliente>
<Nombre>Martin</Nombre>
<Apellido>Rodriguez</Apellido>
<DNI>45868900</DNI>
</Cliente>
</Clientes>