First Load the Document:
var doc = XDocument.Load("c:somefile.xml");
Then you can access the Elements with
XElement xe = doc.Element("Name of the Element");
If you got more than one Element with the same name you can get them with:
IEnumerable<XElement> xe = doc.Elements("Name of the Element");
You can Access Attributes kind of similar:
XAttribute xa = doc.Attribute("Name of the Attribute");
and
IEnumerable<XAttribute> xa = doc.Attributes("name");
don't forget to always do null checks.
I hope this helps.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…