title: SOAP Response to DataTable in C#
body: <p>I have been searching and trying in many forms to pass an XML Response to a simple DataTable in the same way Excel does.</p>
  
  <p>The XML is like:</p>
  
  <pre><code>&lt;?xml version="1.0" standalone="no"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
          &lt;SOAPSDK4:Function xmlns:SOAPSDK4="http://www.externalwebservice.com/message/"&gt;
              &lt;Lists&gt;
                  &lt;ListCode&gt;12345&lt;/ListCode&gt;
                  &lt;ListGroups&gt;
                      &lt;ListGroup&gt;
                          &lt;CodeGroup&gt;ASDF&lt;/CodeGroup&gt;
                          &lt;DescriptionGroup&gt;Example&lt;/DescriptionGroup&gt;
                      &lt;/ListGroup&gt;
                  &lt;/ListGroups&gt;
                  &lt;List&gt;
                      &lt;CodeList&gt;ABC&lt;/CodeList&gt;
                      &lt;DescriptionList&gt;Example List&lt;/DescriptionList&gt;
                      &lt;ListCategories&gt;
                          &lt;ListCategory&gt;Type1&lt;/ListCategory&gt;
                          &lt;ListCategory&gt;Type2&lt;/ListCategory&gt;
                      &lt;/ListCategories&gt;
                      &lt;ListKinds&gt;
                          &lt;Kind&gt;
                              &lt;KindType&gt;A&lt;/KindType&gt;
                              &lt;KindTarget&gt;1&lt;/KindTarget&gt;
                              &lt;KindAttributes&gt;
                                  &lt;KindAttribute1&gt;A&lt;/KindAttribute1&gt;
                                  &lt;KindAttribute2&gt;B&lt;/KindAttribute2&gt;
                              &lt;/KindAttributes&gt;
                          &lt;/Kind&gt;
                      &lt;/ListKinds&gt;
                  &lt;/List&gt;
              &lt;/Lists&gt;
          &lt;/SOAPSDK4:Function&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>What Excel does could help me in what I need and that is to fill 4 tables with this data and its relations.</p>
  
  <p>I have tried using DataSet.ReadXML but the problem with it is that for some reason this method generates 14 tables with the data being of no use because there is no relation at all.
  Later I tried with DataTable.ReadXML but it gave me the problem "DataTable does not support schema inference from Xml." then tried to use DataTable.ReadXmlSchema(XML) and it gave an error with no root document, then I created an XSD with the command prompt and the two generated gave an error, finally I used Visual Studio to generate the XSD, it generated 4 XSD with no errors but no columns where created and no data was added with none of them.</p>
  
  <p>I am out of ideas now. Any suggestions? Maybe not a DataTable with no normalized data (what Excel does) but another approach going directly with the XML?</p>
  
  <p>Thank you.</p>