[XmlRoot("個人情報",Namespace ="http://www.atmarkIT.co.jp/xmlns/sample/person")] public class Person { private string name = "未設定"; private int age = 0; [XmlElement("名前",Namespace ="http://www.atmarkIT.co.jp/xmlns/sample/name")] public string Name { get { return name; } set { name = value; } } [XmlElement("年齢",Namespace ="http://www.atmarkIT.co.jp/xmlns/sample/age")] public int Age { get { return age; } set { age = value; } } public void Dump() { System.Diagnostics.Trace.WriteLine(name); System.Diagnostics.Trace.WriteLine(Age); } }