title: How to bind xsd file correctly in C# WPF for example to show some elements of the schema?
body: <p>Let's say I have a <strong>WPF</strong> project in VisualStudio and an <strong>xsd</strong> file which I need to <strong>bind</strong> to and <strong>show</strong> some of the elements in a <strong>combobox</strong>. Below is an <strong>example</strong> of <strong>xsd</strong> which I have and my <strong>xaml</strong>. It looks like it should be a straight forward thing but it just does not work. Could you please help me?</p>
  
  <p>Edit 1: I know that <strong>xsd is not the source</strong> of data but it is <strong>an xml document by itself</strong>. And for example there might be need to give user a look over what options are available.</p>
  
  <p>xsd:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema id="TypedDataSet" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xs:annotation&gt;
          &lt;xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"&gt;
              &lt;DataSource DefaultConnectionIndex="0" 
                          FunctionsComponentName="QueriesTableAdapter" 
                          Modifier="AutoLayout, AnsiClass, Class, Public" 
                          SchemaSerializationMode="IncludeSchema" 
                          xmlns="urn:schemas-microsoft-com:xml-msdatasource"&gt;
                  &lt;Connections /&gt;
                  &lt;Tables /&gt;
                  &lt;Sources /&gt;
              &lt;/DataSource&gt;
          &lt;/xs:appinfo&gt;
      &lt;/xs:annotation&gt;
      &lt;xs:element name="TypedDataSet"&gt;
          &lt;xs:complexType&gt;
              &lt;xs:choice minOccurs="0" 
                         maxOccurs="unbounded"&gt;
                  &lt;xs:element name="Orders"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="OrderID" 
                                          type="xs:string" 
                                          minOccurs="0" /&gt;
                              &lt;xs:element name="OrderTypeID" 
                                          type="xs:string" 
                                          minOccurs="0" /&gt;
                              &lt;xs:element name="OrderDate" 
                                          type="xs:string" 
                                          minOccurs="0" /&gt;
                          &lt;/xs:sequence&gt;
                      &lt;/xs:complexType&gt;
                  &lt;/xs:element&gt;
                  &lt;xs:element name="OrderTypes"&gt;
                      &lt;xs:complexType&gt;
                          &lt;xs:sequence&gt;
                              &lt;xs:element name="OrderTypeID" 
                                          type="xs:string" 
                                          minOccurs="0" /&gt;
                              &lt;xs:element name="OrderTypeName" 
                                          type="xs:string" 
                                          minOccurs="0" /&gt;
                              &lt;xs:element name="Rank" 
                                          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;
  </code></pre>
  
  <p>xaml:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;XmlDataProvider x:Key="Test" Source="C:\Test\Test.xsd"/&gt;
  &lt;/Window.Resources&gt;
  &lt;Grid&gt;
      &lt;StackPanel&gt;
          &lt;ComboBox ItemsSource="{Binding Source={StaticResource Test}, XPath=xs://element}" 
                    DisplayMemberPath="@name"/&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>