title: Convert xml to key-value pair notation
body: <p>I use <code>xmlstarlet el -v</code> to display the structure of an xml file, including all the attributes and values. I would like to convert its output to some sort of key-value pairs, i.e. each attribute with its value on a separate line (including the XPath); each line must be unique.</p>
  
  <p>Current result:</p>
  
  <pre><code>topRoot/topSystem/commSvcEp/commSyslog[@descr='Syslog Service' and @name='syslog' and @policyOwner='local' and @severity='critical']
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='secondary' and @severity='critical']
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='tertiary' and @severity='critical']
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[@adminState='disabled' and @forwardingFacility='local7' and @hostname='none' and @name='primary' and @severity='critical']
  </code></pre>
  
  <p>Desired result (could be anything similar; the indices are just an idea):</p>
  
  <pre><code>topRoot/topSystem/commSvcEp/commSyslog@descr='Syslog Service'
  topRoot/topSystem/commSvcEp/commSyslog@name='syslog'
  topRoot/topSystem/commSvcEp/commSyslog@policyOwner='local'
  topRoot/topSystem/commSvcEp/commSyslog@severity='critical'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@adminState='disabled'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@forwardingFacility='local7'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@hostname='none'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@name='secondary'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[0]@severity='critical'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@adminState='disabled'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@forwardingFacility='local7'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@hostname='none'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@name='tertiary'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[1]@severity='critical'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@adminState='disabled'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@forwardingFacility='local7'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@hostname='none'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@name='primary'
  topRoot/topSystem/commSvcEp/commSyslog/commSyslogClient[2]@severity='critical'
  </code></pre>
  
  <p>What I'm trying to accomplish, is being able to run <code>diff</code> over two such files or using <code>grep</code> to filter matching patterns. I'm sure there's a way to create such output, without using <code>sed</code>, <code>awk</code> or anything else but <code>xmlstarlet</code> itself.</p>
  
  <p>I'm pretty much a newbie regarding xmlstarlet and the whole xml world (not only by the fact that I dislike xml due to its complexity and parsing overhead, etc), so I'd really appreciate your help. Thanks!</p>