title: Removing duplicate elements in XML
body: <p>My project requires a functionality to convert the input XML file into DataTable.
  I am using the following code to do that.</p>
  
  <pre><code> DataSet ds = new DataSet();
   ds.Locale = CultureInfo.InvariantCulture;
   dataSourceFileStream.Seek(0, SeekOrigin.Begin);
   ds.ReadXml(dataSourceFileStream);
   dt = ds.Tables[0];
  </code></pre>
  
  <p>This works quiet right unless the input XML has duplicate elements, for eg, if the XML file is like below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;DocumentElement&gt;
   &lt;data&gt;
     &lt;DATE&gt;27 September 2013&lt;/DATE&gt;
     &lt;SCHEME&gt;Test Scheme Name&lt;/SCHEME&gt;
     &lt;NAME&gt;Mr John&lt;/NAME&gt;
     &lt;SCHEME&gt;Test Scheme Name&lt;/SCHEME&gt;
    &lt;TYPE&gt;1&lt;/TYPE&gt;
   &lt;/data&gt;
  &lt;/DocumentElement&gt;
  </code></pre>
  
  <p>As you can see above, the element <strong>SCHEME</strong> appears twice. when this kind of XML file comes <code>ds.ReadXml(dataSourceFileStream);</code> fails to return right data table. </p>
  
  <p>Any better way to handle this?</p>