Inefficient IEnumerable Select Statement on XDocument
<p>I have the following code and it is working fine. However I am new to using "IEnumerable code" and it would seem obvious that it could be done better. </p>

<p>Basically I want all Region nodes in the XML and then the data I want to output in my Asp:repeater is nested quite deeply in the XML, but the 4 fields are all at the same level.</p>

<pre><code>var xDoc = xmlDoc.ToXDocument();

var jobs = xDoc.Descendants("Region")
    .Select(x =&gt; new {
        jobName = x.Element("Location").Element("Department").Element("Brand").Element("Jobs").Element("Job").Element("JobName").Value,
        jobType = x.Element("Location").Element("Department").Element("Brand").Element("Jobs").Element("Job").Element("JobType").Value,
        jobURL = x.Element("Location").Element("Department").Element("Brand").Element("Jobs").Element("Job").Element("URL").Value,
        jobClose = x.Element("Location").Element("Department").Element("Brand").Element("Jobs").Element("Job").Element("JobCLDate").Value
    }
);

if (jobs.Count() &gt; 0)
{
    careersListing.DataSource = jobs;
    careersListing.DataBind();
    careersListing.Visible = true;
}
</code></pre>

<p>I would be very grateful of any feedback with respect to making it more succinct</p>

<p>Thanks</p>

<p>Nigel</p>
