// 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 = @" a 0 Alpha 1 Beta b 0 Gamma 1 Epsilon "; XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlstr); XmlElement root = doc.DocumentElement; Console.Write( root.SelectSingleNode("//menu[id='b']/row[id='1']/vis/text()").Value ); Console.Write( root.SelectSingleNode("//menu[id='b']/row[id='0']/vis/text()").Value ); Console.WriteLine(); } } }