Getting key and value of attributes in xml tag
<p>So If I had this following tag:</p>

<pre><code>&lt;ana lex="ун" morph="ың" gr="NUM,poss.2sg" trans="десять" /&gt;
</code></pre>

<p>I want to extract not just the value but more specifically the names of the attributes. I have already tried using the names function like so (where ana is the above tag):</p>

<pre><code> at_names = ana.xpath('name(@*)')
</code></pre>

<p>However, this only returns the first attribute name 'lex'. How could I get a list of all attribute names in a tag?</p>