title: How to loop within a Linq to XML statement
body: <p>How how can I do this:</p>
  
  <pre><code>XDocument xDocument = new XDocument(new XElement("SqlInstall",
              new XElement("Catalogs",
                      new XElement("Install"),
                      foreach (var item in packagedProduct.Installs)
                      {
                              new XElement("File ")..
                      }
  
                      ))));
  </code></pre>
  
  <p>It complains about the foreach loop within the Linq statement with "invalid expression term foreach"</p>