title: XML Injection C#
body: <pre><code>XmlDocument doc = new XmlDocument();
  doc.LoadXml(template);
  XmlElement list = doc.CreateElement(conn.XmlListTagName);
  foreach (EaiItem updateItem in itemList)
  {
      XmlElement item = doc.CreateElement( conn.XmlItemTagName );
      foreach(String itemAttrib in updateItem.ItemAttributes.Keys)
      {
          item.SetAttribute(itemAttrib, updateItem.ItemAttributes[itemAttrib]);
      }
      item.InnerXml = updateItem.ItemFieldXml;
      list.AppendChild(item);
  }
  doc.LastChild.AppendChild(list);
  </code></pre>
  
  <p>Fortify tool displaying the xml injection in the below code</p>
  
  <pre><code> item.InnerXml = updateItem.ItemFieldXml;
  </code></pre>
  
  <p>How to prevent the xml injection issue ?</p>