I've an XML file like below:
<Employees>
<Employee Id="ABC001">
<Name>Prasad 1</Name>
<Mobile>9986730630</Mobile>
<Address Type="Perminant">
<City>City1</City>
<Country>India</Country>
</Address>
<Address Type="Temporary">
<City>City2</City>
<Country>India</Country>
</Address>
</Employee>
Now I want get all Address Type's.
I tried like below using XPath and I'm getting exception.
var xPathString = @"//Employee/Address/@Type";
doc.XPathSelectElements(xPathString); // doc is XDocument.Load("xml file Path")
Exception: The XPath expression evaluated to unexpected type System.Xml.Linq.XAttribute.
Is there any issue with my XPath?