Hi guys,

I have a XML file that I'm reading as a string and then searching into. The problem is that the SelectSingleNode is failing for any non-root node.

To access the <HostName> value, I use
string xmlFile = "<?xml ..............................."; //Has the XML data
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlFile);

XmlElement root = doc.DocumentElement;
XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
nsmgr.AddNamespace("config", "http://tempuri.org/ConfigSchema.xsd");

XmlNode test = root.SelectSingleNode("//config:HostName", nsmgr);
Console.WriteLine(test.InnerText);

The above works and prints out "test123" but if I want to select <NIC0><Name>, what do I write? The below failed:

XmlNode test = root.SelectSingleNode("//config:NIC0/Name", nsmgr);

My XML is:
<?xml version="1.0" encoding="utf-16"?>
<Configuration xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/ConfigSchema.xsd">
<ConfigVersion>V2.0</ConfigVersion>
<ConfigHash>E9D9A</ConfigHash>
<HostName>test123</HostName>

<NIC0>
<Active>True</Active>
<Name>Intel(R) 82567LM Gigabit Network Connection</Name>
<IP>192.126.3.3</IP>
<MAC>00:1C:25:24:14:R8</MAC>
<Manufacturer />
</NIC0>
</Configuration>