Iterate through xml tree with unknown structure and size (for xml to registry)
<p>Thanks in advance.  I have an xmldocument of unknown structure and dissimilar elements.  I want to iterate through all elements getting the element name and it's value ultimately to rebuild the xml document into registry keys and values</p>

<p>example</p>

<pre><code>&lt;Root&gt;
  &lt;Names&gt;
    &lt;Name&gt;Bob&lt;/Name&gt;
  &lt;/Names&gt;
  &lt;Locations&gt;
    &lt;States&gt;
      &lt;State&gt;Ohio&lt;/State&gt;
      &lt;State&gt;Michigan&lt;/State&gt;
      &lt;State&gt;
        Florida
        &lt;WeatherType&gt;Hot&lt;/WeatherType&gt;
      &lt;/State&gt;
    &lt;/States&gt;
  &lt;/Locations&gt;
&lt;/Root&gt;
</code></pre>

<p>the output would include the xpath (which I would use for the reg path) for each element value (which i will use for the reg key value).  Output would look something like this.</p>

<pre><code>Root\Names\Name = Bob
Root\Locations\States\State = Ohio
Root\Locations\States\State = Michigan
Root\Locations\States\State = Florida
Root\Locations\States\State\Florida\WeatherType = Hot
</code></pre>