title: How to flatten this XML
body: <p>I am receiving an xml message like the below (Believe me this is NOT how I want it):</p>
  
  <pre><code>&lt;items&gt;
   &lt;item item="A" position="0"&gt;
     &lt;itemvalue&gt;10&lt;/itemvalue&gt;
   &lt;/item&gt;
    &lt;item item="A" position="1"&gt;
      &lt;itemvalue&gt;20&lt;/itemvalue&gt;
   &lt;/item&gt;
    &lt;item item="A" position="2"&gt;
      &lt;itemvalue&gt;30&lt;/itemvalue&gt;
   &lt;/item&gt;
    &lt;item item="B" position="0"&gt;
      &lt;itemvalue&gt;10&lt;/itemvalue&gt;
    &lt;/item&gt;
     &lt;item item="B" position="1"&gt;
       &lt;itemvalue&gt;20&lt;/itemvalue&gt;
    &lt;/item&gt;
     &lt;item item="B" position="2"&gt;
       &lt;itemvalue&gt;30&lt;/itemvalue&gt;
   &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>I am shredding the XML using LINQ.  So what I get is a List of Item | Position | Value.  How I really want the data is to match my table structure.  </p>
  
  <pre><code>Item  | Column1 | Column2 | Column3
  A         10        20        30
  </code></pre>
  
  <p>What is the best way for me to take that List and Build a separate Object I can pass to the DB.  Right now I am getting the distinct list of Items (So A &amp; B here) and then passing that into a Lambda expression so that I can say give me the value where Item = A and Position = X (0,1,2).  </p>
  
  <p>Just wondering what the best method would be to "flatten" this poorly structured XML. </p>