c# - How to get the tag name using Linq to XML -


If you have an XElement obj, how can you get tag name of the excelant object?

  doctor Descendants ("name"). Where (x => (string) x == cit.name). FirstOrDefault () Parents  

I tagged the name of this xelement object

Once you have the correct XElement , you can use the property like this:

    

  string name = element Name.localname; // will get "some element"  

Comments