[code]
// load config file XElement config = XElement.Load("config.xml"); // load games var groups = from gameGroup in config.Descendants("group") select new { Name = gameGroup.Attribute("name").Value, Games = from game in gameGroup.Descendants("game") select new { Name = game.Attribute("name").Value, Path = game.Attribute("path").Value } };
[xml]
<games> <group name="arcade"> <game name="Alley Cat #GGGC" path="\games\alleycat\cat.exe"/> <game name="Dangeours Dave" path="\games\dandave\1.exe"/> </group> <group name="strategy"> <game name="Dyna Blaster" path="\games\dynablaster\dyna.exe"/> </group> </games>