title: How can I parse XML in PowerShell when each property has a unique name?
body: <p>I have an xml file like so:</p>
  
  <pre><code>&lt;employees&gt;   
      &lt;employee&gt;
          &lt;name&gt;Johnny Rocket&lt;/name&gt;
          &lt;age&gt;40&lt;/age&gt;
          &lt;somethingelse&gt;Whatever&lt;/somethingelse&gt;
          &lt;another&gt;Whatever Again&lt;/another&gt;
          ##.... lots more ....##
      &lt;/employee&gt;
      &lt;employee&gt;
          ##......
      &lt;/employee&gt;
  
  &lt;/employees&gt;
  </code></pre>
  
  <p>I want to create a custom PowerShell object for each "employee" you see. However, I don't want to have to explicitly state the properties (Name, Age, SomethingElse, Whatever), because in reality there are tens of them. I want to have each property of my object to be named what's in the brackets.</p>
  
  <p>I would also want the solution to work if what's in the brackets is two words. In the following example, I would want the object's member to be named "Food" with value "Pasta": </p>
  
  <p><code>&lt;Food Type="Italian"&gt;Pasta&lt;/Food&gt;</code>)</p>
  
  <p>Is there a solution that can create a custom object whose member names are defined by what is in the brackets, which works with PowerShell 2?</p>