 <p>you need to remove this semicolon</p> <pre><code> Name = p.Attribute("Name").Value, Type = (EnvironmentType)Enum.Parse(typeof (EnvironmentType), p.Attribute("Type").Value, true), DataCenters = p.Elements("DataCenter").Select( dc =&gt; new DataCenter { Name = dc.Attribute("Name").Value, DeployEnvironmentName = dc.Attribute ("DeployEnvironmentName").Value }) }); ^^^ }); </code></pre> <p>You shouldn't use semicolons in <a href="http://msdn.microsoft.com/en-us/library/bb384062.aspx" rel="nofollow">object initializers</a>, you should separate the properties with comma.</p>