title: Python ElementTree "Invalid descendant" error
body: <p>I have an XML file, <code>foo.xml</code>:</p>
  
  <pre><code>&lt;foo&gt;
      &lt;bar&gt;
          &lt;baz phrase="hello"/&gt;
      &lt;/bar&gt;
      &lt;quux phrase="goodbye"/&gt;
  &lt;/foo&gt;
  </code></pre>
  
  <p>I'm parsing it with this Python code:</p>
  
  <pre><code>import lxml.etree as ET
  # or if you don't have lxml: import xml.etree.ElementTree as ET
  
  doc = ET.parse('foo.xml').getroot()
  
  for elem in doc.findall('*[@phrase]'):
      print(elem)
  </code></pre>
  
  <p>That gives me:</p>
  
  <pre><code>&lt;Element 'quux' at 0x7fa1419a1d18&gt;
  </code></pre>
  
  <p>Now I want to find all elements with a <code>phrase</code> attribute, so I tried <code>'.//[@phrase]'</code> but then <code>findall()</code> fails:</p>
  
  <pre><code>SyntaxError: invalid descendant
  </code></pre>
  
  <p>I don't understand what's wrong.  The same error message appears if I use the built-in <code>xml.etree.ElementTree</code> instead of <code>lxml</code>.</p>
  
  <p>Note that <code>'.//'</code> works, but returns <code>bar, baz, quux</code> and I don't want <code>bar</code> because it doesn't have a <code>phrase</code> attribute.</p>