title: WPF, using XPath in XAML with XmlDataProvider to select nodes based on selected value in ComboBox
body: <p>This question ties to my <a href="https://stackoverflow.com/questions/3388759/wpf-xml-databinding-into-dependent-cascading-comboboxes">previous question</a> but is more specific.  Say I have two ComboBoxes, one populated with product names, the other empty.  When a product is chosen, I want the second ComboBox to be filled with data related to that product.  I have XML like the following:</p>
  
  <pre><code>&lt;Products&gt;
      &lt;Product name="MyProduct1"&gt;
          &lt;Components&gt;
              &lt;Component name="MyComponent1"/&gt;
              &lt;Component name="MyComponent2"/&gt;
              ...more Component nodes...
          &lt;/Components&gt;
      &lt;/Product&gt;
      ...more Product nodes...
  &lt;/Products&gt;
  </code></pre>
  
  <p>What I was hoping is that I could somehow set the <code>XPath</code> on the Component ComboBox such that it gets all the <code>Components/Component</code> nodes from the <code>Product</code> node whose <code>@name</code> attribute is equal to the currently selected value in the Product ComboBox.  Is this possible?  How would I do it?  Here's what I have in my XAML so far:</p>
  
  <pre><code>&lt;ComboBox Height="23" HorizontalAlignment="Left" Margin="138,116,0,0"
            Name="cbo_product" VerticalAlignment="Top" Width="120"
            ItemsSource="{Binding Source={StaticResource productsXml}}"
            DisplayMemberPath="@name"/&gt;
  &lt;ComboBox Height="23" HorizontalAlignment="Left" Margin="138,151,0,0"
              Name="cbo_component" VerticalAlignment="Top" Width="201"
              DisplayMemberPath="@name"&gt;
      &lt;ComboBox.ItemsSource&gt;
          &lt;!-- Currently gets all Component nodes--want it to get only those
               associated with the selected Product --&gt;
          &lt;Binding Source="{StaticResource productsXml}"
                   XPath="Components/Component"/&gt;
      &lt;/ComboBox.ItemsSource&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>The Product ComboBox is filled with product names like MyProduct1, so that part is fine.  It's the dependent Component ComboBox I need help with.</p>