using System.Xml.Serialization;
using System.Collections.Generic;
public static void Main()
String url = "http://www.w3schools.com/xml/simple.xml";
System.Net.WebClient client = new System.Net.WebClient();
string data = Encoding.Default.GetString(client.DownloadData(url));
var reader = new XmlSerializer(typeof (breakfast));
var breakfast = (breakfast)reader.Deserialize(new StringReader(data));
foreach (var food in breakfast.food)
Console.WriteLine("{0}", food.Name);
[XmlRoot("breakfast_menu")]