XMLをクラスに入れて扱いやすくしたかった。 LINQ to XML についての参考サイト http://code.msdn.microsoft.com/windowsdesktop/22-LINQ-to-XML-XML-c2f6f04f 上のサイトのコード例を少し変えてクラスにぶち込むようにした。 こういうクラスを用意して public class Person { public string ID { get; set; } public string Name { get; set; } } XMLの要素をクラスにぶち込む // XML文字列 string xmldoc = @"<?xml version='1.0'?> <names xmlns='http://www.piedey.co.jp/example/linqtoxml201003'> <name id='M0001'>一