title: How to write XML file from a ListView in C#
body: <p>i'm having a <code>ListView</code> control like</p>
  
  <p><img src="https://i.stack.imgur.com/f7iZY.jpg" alt="alt text"></p>
  
  <p>I need to store the data from this ListView to an Xml File.</p>
  
  <p>So the xml file will be like</p>
  
  <pre><code>&lt;root&gt;
   &lt;Child Name ="A1" val1="1" val2="0"/&gt;
   &lt;Child Name ="A2" val1="1" val2="2"/&gt;
   &lt;Child Name ="A3" val1="1" val2="3"/&gt;
   &lt;Child Name ="A4" val1="1" val2="4"/&gt;
   &lt;Child Name ="A5" val1="1" val2="5"/&gt;
   &lt;Child Name ="A6" val1="6" val2="0"/&gt;
   &lt;Child Name ="A7" val1="7" val2="0"/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>if the data is stored in some <code>List</code> or <code>Dictionary</code> , then i know to do this using XML to LINQ</p>
  
  <p>But how do i do this from a ListView</p>
  
  <pre><code>XDocument XD=new XDocument(new XElement("root",........// what i have to do here.......
  </code></pre>
  
  <p>Please help me to do this...</p>
  
  <p>Thanks in advance</p>