title: Dataset ReadXml returns Rows Instead of Columns
body: <p>I am trying to create a datatable from an xml file, using the dataset readxml method. however i am struggling to define the schema correctly to properly interpret this file.</p>
  <p>i think the problem lies with the nesting and the fact that the ColumnUid (which ideally should be the column name) is a value rather than an element.</p>
  <p>the datatable it returns at the moment has this structure:[<img src="https://i.stack.imgur.com/ke0rS.png" alt="bad table1" /></p>
  <p>and i hope to make it return like this: <a href="https://i.stack.imgur.com/dyen6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dyen6.png" alt="good table" /></a></p>
  <p>is this possible by defining the correct schema to pass to readxml... or even at all?</p>
  <p>I could potentially transpose the datatable after the initial readxml, using eaither linq or a loop but would prefer to avoid this</p>
  <p>the xml is as follows (shortened example):</p>
  <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
  &lt;DataTable Uid=&quot;dtDocRows&quot;&gt;
   &lt;Rows&gt;
      &lt;Row&gt;
       &lt;Cells&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;DocEntry&lt;/ColumnUid&gt;
        &lt;Value&gt;121496&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;DocNum&lt;/ColumnUid&gt;
        &lt;Value&gt;264803&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;LineNum&lt;/ColumnUid&gt;
        &lt;Value&gt;0&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;ItemCode&lt;/ColumnUid&gt;
        &lt;Value&gt;BENIGRAMST55060075L&lt;/Value&gt;
      &lt;/Cell&gt;       
      &lt;Cell&gt;
        &lt;ColumnUid&gt;Quantity&lt;/ColumnUid&gt;
        &lt;Value&gt;1.000000&lt;/Value&gt;
      &lt;/Cell&gt;   
    &lt;/Cells&gt; 
  &lt;/Row&gt;
  &lt;Row&gt;
    &lt;Cells&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;DocEntry&lt;/ColumnUid&gt;
        &lt;Value&gt;121658&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;DocNum&lt;/ColumnUid&gt;
        &lt;Value&gt;264965&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;LineNum&lt;/ColumnUid&gt;
        &lt;Value&gt;0&lt;/Value&gt;
      &lt;/Cell&gt;
      &lt;Cell&gt;
        &lt;ColumnUid&gt;ItemCode&lt;/ColumnUid&gt;
        &lt;Value&gt;PYCCHANT202575L&lt;/Value&gt;
      &lt;/Cell&gt;      
      &lt;Cell&gt;
        &lt;ColumnUid&gt;Quantity&lt;/ColumnUid&gt;
        &lt;Value&gt;1.000000&lt;/Value&gt;
      &lt;/Cell&gt;       
    &lt;/Cells&gt;
  &lt;/Row&gt;
  </code></pre>
  <p>and the c# function to return the datatable is this:</p>
  <pre><code>private DataTable getDotNetDataTable()
  {
      DataSet ds = new DataSet();
      XDocument xdoc = XDocument.Parse(dtDocRows.SerializeAsXML(SAPbouiCOM.BoDataTableXmlSelect.dxs_DataOnly));
      xdoc.Save(@&quot;C:\1\xml\test.xml&quot;);
      ds.ReadXml(@&quot;C:\1\xml\test.xml&quot;);
      return ds.Tables.Item(4);
  
      return dt;
  }
  </code></pre>