title: How I can fill my DropDownList with Data from a XML File in my ASP.NET Application
body: <p>I have a ASP.NET Application with a DropDownList and I want it fill with my XML File Values. 
  How I can I use my XML for this that I create a new item for every Value in my XML.</p>
  
  <p><strong>My XML File:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes" ?&gt;
  &lt;NewDataSet&gt;
    &lt;xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"&gt;
      &lt;xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
            &lt;xs:element name="resources"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:sequence&gt;
                  &lt;xs:element name="Werk" type="xs:string" minOccurs="0" /&gt;        
                &lt;/xs:sequence&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
          &lt;/xs:choice&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
    &lt;/xs:schema&gt;
    &lt;resources&gt;
      &lt;Werk&gt;foo1&lt;/Werk&gt;      &lt;!-- The first Value--&gt;
    &lt;/resources&gt;
    &lt;resources&gt;
      &lt;Werk&gt;foo2&lt;/Werk&gt;      &lt;!-- The second Value--&gt;
    &lt;/resources&gt;
    &lt;resources&gt;
      &lt;Werk&gt;foo3&lt;/Werk&gt;      &lt;!-- The third Value--&gt;
    &lt;/resources&gt;
  &lt;/NewDataSet&gt;
  </code></pre>
  
  <p><strong>In my ASPX:</strong></p>
  
  <pre><code>&lt;asp:XmlDataSource ID="XMLData" runat="server" DataFile="~/App_Data/Werke.xml" /&gt;
          &lt;asp:DropDownList ID="dropWerk" runat="server" Width="245px" /&gt;
  </code></pre>
  
  <p>I need a kind of a Method that fill my DropDownList with the Data from the XML File</p>
  
  <p>tarasov</p>
  
  <p><strong>CS File:</strong></p>
  
  <pre><code>private void BindXML()
          {
            XmlDocument xmldoc = XMLData.GetXmlDocument();
  
            using (DataSet ds = new DataSet())
            {
                ds.ReadXml(XMLData.DataFile);
                dropWerk.DataSource = ds;
                dropWerk.DataTextField = "Werk";
                dropWerk.DataBind(); 
            }
          }
  </code></pre>