Access Child nodes with namespace using xpath

How can I read the content of the childnotes using Xpath?

I have already tried this:

var xml = new XmlDocument();
var ns = new XmlNamespaceManager(xml.NameTable);
ns.AddNamespace("ns", "namespace");
var node = xml.SelectSingleNode("descendant::ns:server[ns:ip-address]", ns)

But I only get a string like this:

<ip-address></ip-address><name>Server 1</name><group>DATA</group>

How can I get the values individually?

Xml file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<server-status xmlns="namespace">
        <name>Server 1</name>


You’re using XML namespaces in XPath correctly.

However, your original XPath,


says to select all ns:server elements with ns:ip-address children.

If you wish to select the ns:ip-address children themselves, instead use


Similarly, you could select ns:name or ns:group elements.