// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Xml; namespace E { public class Program { public static void Main(string[] args) { string xmlstr = @"]]>]]>]]>]]>"; XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlstr); XmlNamespaceManager nsm = new XmlNamespaceManager(doc.NameTable); nsm.AddNamespace("df1", "http://df1"); nsm.AddNamespace("df2", "http://df2"); nsm.AddNamespace("df3", "http://df3"); foreach(XmlNode n in doc.SelectNodes("/a/df2:c/df2:x/text()", nsm)) { Console.WriteLine(n.Value); } Console.ReadKey(); } } }