title: Update XML with C# using Linq
body: <p>MY XML FILE STRUCTURE </p>
  
  <pre><code>&lt;items&gt;
    &lt;item&gt;
      &lt;itemID&gt;1&lt;/itemID&gt;
      &lt;isGadget&gt;True&lt;/isGadget&gt;
      &lt;name&gt;Star Wars Figures&lt;/name&gt;
      &lt;text1&gt;LukeSkywalker&lt;/text1&gt;
    &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>TO READ DATA FROM XML BY ITEMID</p>
  
  <pre><code>XDocument xmlDoc = XDocument.Load(HttpContext.Current.Server.MapPath("data.xml"));
  var items = from item in xmlDoc.Descendants("item")
              where item.Element("itemID").Value == itemID
              select new
              {
                  itemID = item.Element("itemID").Value,
                  isGadget = bool.Parse(item.Element("isGadget").Value),
                  name = item.Element("name").Value,
                  text1 = item.Element("text1").Value,
               }
  
  foreach (var item in items)
  {
       ....
  }
  </code></pre>
  
  <p>How to update XML data by itemID?
  Thanks!</p>