title: Get all attributes in XML
body: <p>I have an XML like this:</p>
  
  <pre><code>&lt;msg action="getDetails" class="2"&gt;
     &lt;stamps msgtime="4/15/2014" ltq="2014-04-15"&gt;
         &lt;dat la="get" /&gt;
     &lt;/stamps&gt;
  &lt;/msg&gt;
  </code></pre>
  
  <p>How can I retrieve Dictionary of all the attributes and their corresponding values? The expected output should look this:</p>
  
  <blockquote>
    <p>action - getDetails<br>
    class - 2<br>
    msgtime - 4/15/2014<br>
    ltq - 2014-04-15<br>
    la - get</p>
  </blockquote>
  
  <p>I can get it work for a particular level, but not for all child elements.</p>