title: How can I maintain the treestructure of my xml-file in the code and access the "subtags"?
body: <p>Hey have a little problem,
  I'm having a xml-file structured like this:</p>
  
  <pre><code>&lt;cars&gt;
    &lt;car name="audi" id="123"&gt;
      &lt;specs fuel="gas"/&gt;
      &lt;specs horsepower="150"/&gt;
    &lt;/car&gt;
    &lt;car name="tesla" id="456"&gt;
      &lt;specs fuel="electric"/&gt;
      &lt;specs horsepower="600"/&gt;
    &lt;/car&gt;
  &lt;/cars
  </code></pre>
  
  <p>I am trying to read all the data and maintain the treestructure from the xml in the code so that I can display the car that I want lateron. Therefore I used an ObservableCollection.
  I tried it like this:</p>
  
  <pre><code>        XElement data = XElement.Load(path);
  
          IEnumerable&lt;XElement&gt; elements = data.Elements().Elements();
  
          XmlData = new ObservableCollection&lt;XElement&gt;();
  
          foreach(var item in elements)
          {
              XmlData.Add(item);
          }
  </code></pre>
  
  <p>With this method it doesn't add them in the collection. How can I get the different nodes from the loaded XElements and store them in an ObservableCollection? Or is there a much easier way to do this?
  Thanks already :)</p>