title: What is the correct way to replace a static XmlDataProvider in a WPF Usercontrol with a dynamic dataset?
body: <p>Question may need to be edited since I don't think I necessarily know the best way to do this.</p>
  
  <p>Current config of my WPF usercontrol.
  I have a XmlDataProvider that contains some static XML Elements that I use to populate a TreeView control.
  I currently use a HierarchicalDataTemplate to bind to a TreeViewItem</p>
  
  <pre><code>    &lt;HierarchicalDataTemplate x:Key="SiteTemplate" ItemsSource="{Binding XPath=pci}"&gt;
          &lt;TextBlock Text="{Binding XPath=@Name}"/&gt;
      &lt;/HierarchicalDataTemplate&gt;
      &lt;Style TargetType="TreeViewItem"&gt;
          &lt;Setter Property="IsExpanded" Value="True"/&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>TreeView control</p>
  
  <pre><code> &lt;TreeView ItemsSource="{Binding Source={StaticResource SharePointSites}}" 
                                ItemTemplate="{StaticResource SiteTemplate}" 
  </code></pre>
  
  <p>I would like to replace the current static resource with data that is loaded from a xml file at runtime. Additionally I want the user to be able to modify the nodes of the treeview at runtime and have those values written back to the same xml file.
  I have been reading up about using the MVVM pattern and creating an IObservable class. Can someone point me in the right direction? </p>
  
  <p>Edit:
  Perhaps I've asked this question in a sub-optimal way. Can anyone recommend improvements or make edits to improve the quality of the question in anyway?</p>