// 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.Linq; using System.Xml; using System.Xml.Linq; namespace E { public class Program { public static void Main(string[] args) { string data = @" City London, United Kingdom 11:11 AM 10 50 113 14 22 250 WSW 0.0 76 10 1026 25 2013-11-29 9 48 3 37 16 25 W W 275 119 0.1 "; XDocument doc = XDocument.Parse(data); Console.WriteLine(doc.Root.Element("current_condition").Element("temp_C").Value); foreach (XElement elm in doc.DescendantNodes().Where(node => node.NodeType == XmlNodeType.Element)) { Console.WriteLine(elm.Name); } } } }