The XElement.Descendants () method accepts the name of the element found.
But it is case sensitive, is there any way to make it case insensitive
You can use this:
element.Descendants() .Where(x => string.Compare(x.Name, filter, StringComparison.OrdinalIgnoreCase) == 0);
This method worked for me ..
XElement selectedElement = doc.Descendants().Where(x => String.Equals((string)x.Attribute("name"), filtertext, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();