title: XMLStarlet - For each <name> element
body: <p>I have the following XML.</p>
  
  <pre><code>&lt;application&gt;
  &lt;name&gt;Activity Monitor.app&lt;/name&gt;
  &lt;path&gt;/Applications/Utilities/Activity Monitor.app&lt;/path&gt;
  &lt;version&gt;10.8.0&lt; /version&gt;&lt;/application&gt;
  &lt;application&gt;
  &lt;name&gt;Adobe Flash Player Install Manager.app&lt;/name&gt;
  &lt;path&gt;/Applications/Utilities/Adobe Flash Player Install Manager.app&lt;/path&gt;
  &lt;version&gt;11.3.300.268&lt;/version&gt;&lt;/application&gt;
  </code></pre>
  
  <p>Using XMLStarlet, I'd like to get the following output:</p>
  
  <pre><code>&lt;package name="Activity Monitor.app"&gt;
  &lt;attribute name="Path"&gt;/Applications/Utilities/Activity Monitor.app&lt;/attribute&gt;
  &lt;attribute name="Ver"&gt;10.8.0&lt;/attribute &gt;
  &lt;package name="Adobe Flash Player Install Manager.app"&gt;
  &lt;attribute name="Path"&gt;/Applications/Utilities/Adobe Flash Player Install Manager.app&lt;/attribute&gt;
  &lt;attribute name="Ver"&gt;11.3.300.268&lt;/attribute&gt;
  </code></pre>
  
  <p>I've tried the command: </p>
  
  <pre><code>xml sel -t  -v "computer/software/applications/application/path" -v "computer/software/applications/application/name" -v computer/software/applications/application/version
  </code></pre>
  
  <p>but this is simply listing all the application then all the paths then all version.
  I am  an XMLStarlet novice so I'd appreciate any/all help!
  Thanks!</p>