using System.Xml.Serialization;
using System.Collections.Generic;
public static void Main()
string xml = "<root><items><item><version>1.0</version><title>Example</title><changelog>http://example.com/changelog.txt</changelog><url>http://www.example.com/download/</url></item></items></root>";
XmlSerializer serializer = new XmlSerializer(typeof(UpdateXML));
UpdateXML updateXml = null;
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
using (var reader = new XmlTextReader(stream))
updateXml = (UpdateXML)serializer.Deserialize(reader);
Console.WriteLine("Deserialized {0} item(s)", updateXml.Items.Count);
[XmlRootAttribute("root")]
private string _versionString;
private string _changelog;
public string VersionString
get { return this._versionString; }
set { this._versionString = value; }
if (string.IsNullOrEmpty(this._versionString))
return new Version(this._versionString);
get { return this._title; }
set { this._title = value; }
[XmlElement("changelog")]
get { return this._changelog; }
set { this._changelog = value; }
get { return this._url; }
set { this._url = value; }
private List<Item> _items;
get { return this._items; }
set { this._items = value; }