I've got the following graphml document on which I would like to perform XPATH queries\[code\]<?xml version="1.0" encoding="UTF-8"?><graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"> <graph id="G" edgedefault="undirected"> <node id="n0"/> <node id="n1"/> <edge id="e1" source="n0" target="n1"/> </graph></graphml>\[/code\]I would like to perform XPATH queries on this document but since it defines a namespace I'm not sure what the names of the nodes are. After searching here I found this question. The accepted answer there is stripping of the namespace declaration and reloading the document so that you can use the local names (which defeats the point of XML namespaces), however there was also a comment which gave me the following syntax:\[code\]var nodeList = input.SelectNodes("//*[local-name()='node']", nsmgr);\[/code\]To be honest I don't really like this solution either. To me it seems that using an \[code\]XMLNameSpaceManager\[/code\] should solve this problem so I tried the following:\[code\]string xmlns = input.DocumentElement.Attributes["xmlns"].Value;XmlNamespaceManager nsmgr = new XmlNamespaceManager(input.NameTable);nsmgr.AddNamespace("graphml", xmlns); //Problematic?var nodeList = input.SelectNodes("//node", nsmgr);\[/code\]However using this \[code\]//node\[/code\] doesn't give me any results, this is probably causes by the line which I marked problematic, I'm not sure how the namespace for GrapML is called and I cant find it in the XSD document (I don't know where to look). Anybody got any tips?