A pythonic way to use Lxml to find all elements of a certain type
<p>I'm not very good with Lxml but thought a few of you might know how one can quickly get through the following task.  See below...  Specifically, I need to parse the XML to get the value of the name attribute in all of the category elements.  For example:</p>

<pre><code>&lt;categories&gt;
  &lt;category name="Test"&gt;
    &lt;p&gt;test_1&lt;/p&gt;
  &lt;/category&gt;
  &lt;category name="Acme"&gt;
    &lt;p&gt;acme_1&lt;/p&gt;
  &lt;/category&gt;
&lt;/categories
</code></pre>

<p>So for the above case, the results would be the following category names as a result:</p>

<pre><code>Test
Acme
</code></pre>

<pre><code>names = root_el.xpath('//category/@name')
</code></pre>

python xml lxml