title: Get Xpath dynamically using ElementTree getpath()
body: <p>I need to write a dynamic function that finds elements on a subtree of an ATOM xml by building dynamically the XPath to the element.</p>
  
  <p>To do so, I've written something like this:</p>
  
  <pre><code>    tree = etree.parse(xmlFileUrl)
      e = etree.XPathEvaluator(tree, namespaces={'def':'http://www.w3.org/2005/Atom'})
      entries = e('//def:entry')
      for entry in entries:
          mypath = tree.getpath(entry) + "/category"
          category = e(mypath)
  </code></pre>
  
  <p>The code above fails to find "category" because getpath() returns an XPath without namespaces, whereas the XPathEvaluator e() requires namespaces.</p>
  
  <p>Although I know I can use the path and provide a namespace in the call to XPathEvaluator, I would like to know if it's possible to make getpath() return a "fully qualified" path, using all the namespaces, as this is convenient in certain cases.</p>
  
  <p>(This is a spin-off question of my earlier question: <a href="https://stackoverflow.com/questions/13091717/python-xpathevaluator-without-namespace">Python XpathEvaluator without namespace</a>)</p>