title: Powershell loop through xml to create a jagged array
body: <p>I'm guessing this is pretty simple, I'm just starting with powershell and I can't seem to find a simple solution after a few hours searching the net.</p>
  
  <p>Basically I have the following xml file</p>
  
  <pre><code>&lt;Config&gt;
  &lt;System&gt;
  &lt;Server&gt;
      &lt;Name&gt;host1&lt;/Name&gt; 
      &lt;Service&gt;service1&lt;/Service&gt;
      &lt;Service&gt;service2&lt;/Service&gt;
  &lt;/Server&gt;
  &lt;Server&gt;
      &lt;Name&gt;host2&lt;/Name&gt; 
      &lt;Service&gt;service1&lt;/Service&gt;
  &lt;/Server&gt;
  &lt;/System&gt;
  
  &lt;System2&gt;
  &lt;Server&gt;
      &lt;Name&gt;host1&lt;/Name&gt; 
      &lt;Service&gt;service1&lt;/Service&gt;
      &lt;Service&gt;service2&lt;/Service&gt;
  &lt;/Server&gt;
  &lt;Server&gt;
      &lt;Name&gt;host2&lt;/Name&gt; 
      &lt;Service&gt;service1&lt;/Service&gt;
       &lt;Service&gt;service2&lt;/Service&gt;
       &lt;Service&gt;service3&lt;/Service&gt;
  
  &lt;/Server&gt;
  &lt;/System2&gt;
  &lt;/Config&gt;
  </code></pre>
  
  <p>And I would like to get the contents into a jagged 2d array, so system would wind up as follows:</p>
  
  <ul>
  <li>(host1),(service1,service2)</li>
  <li>(host2),(service1)</li>
  </ul>
  
  <p>Is it possible to iterate through each  element and create such an array?</p>
  
  <p>I'm hoping to store the data as above so that I can use [0][0] to reference the hostname and then [1][1..x] to reference all services for that host.</p>
  
  <p>Does that make any sense?</p>
  
  <p>Any help or better appraoch is greatly appreciated.</p>