I am having some trouble parsing an XML file with the root node having multiple namespaces. I want to get a list of nodes \'object\' with type string containing \'UserContro
One more trick with namespaces - you can use XElement.GetDefaultNamespace() to get default namespace of root element. Then use this default namespace for querying:
var xdoc = XDocument.Load(path_to_xml);
var ns = xdoc.Root.GetDefaultNamespace();
var objects = xdoc.Descendants(ns + "object");