Is there a way to programmatically dim a backlit keyboard on a Mac?


Question: linq to xml query with all attributes
Answer: var menus = doc.Root
                .Elements("Product")
                .Where(p =&gt; (string)p.Attribute("Code") == "10000000000000000006")
                .SelectMany(p =&gt; p.Element("Providers").Elements("Provider"))
                .Where(p =&gt; (string)p.Attribute("Code") == "VODA")
                .SelectMany(p =&gt; p.Element("Menus").Elements("Menu"))
                .ToList();


It returns all 3 menu elements for your sample data. You can use projection to get anonymous object instead of XElement:

var menus = doc.Root
               .Elements("Product")
               .Where(p =&gt; (string)p.Attribute("Code") == "10000000000000000006")
               .SelectMany(p =&gt; p.Element("Providers").Elements("Provider"))
               .Where(p =&gt; (string)p.Attribute("Code") == "VODA")
               .SelectMany(p =&gt; p.Element("Menus").Elements("Menu"))
               .Select(m =&gt; new {
                   Name = (string)m.Attribute("Name"),
                   Url = (string)m.Attribute("Url"),
                   DisplayOrder = (int)m.Attribute("DisplayOrder")
               })