title: Parsing output of svn list command - Cannot get attribute
body: <p>I am using the saved output of :</p>
  
  <pre><code>svn list -R --xml directory
  </code></pre>
  
  <p>As input to a python script, my current code using python 2.6.5:</p>
  
  <pre><code>import os
  import os.path
  import sys
  import lxml.etree
  
  if len(sys.argv) == 2:
      in_filename = str(sys.argv[1])
      if os.path.isfile (in_filename):
          for ent in lxml.etree.parse (in_filename).iter ('entry'):
              get = ent.xpath
              if ent.get ("kind") == "file":
                  log_filename = get ('string(name)')
                  log_revision = get ('string(revision)') # This needs Fixing!
                  log_date = get ('string(commit/date)')
                  print('{0},{1},{2}'.format(log_revision,log_date[:10],log_filename))
  </code></pre>
  
  <p>I cannot extract the <code>revision="1581"</code> attribute (just the <code>1581</code> is what i need) from the entry, where an entry looks like this:</p>
  
  <pre><code>&lt;entry kind="file"&gt;
    &lt;name&gt;path/file.c&lt;/name&gt;
    &lt;size&gt;3973&lt;/size&gt;
    &lt;commit revision="1581"&gt;
      &lt;author&gt;user&lt;/author&gt;
      &lt;date&gt;2012-09-06T15:40:13.396582Z&lt;/date&gt;
    &lt;/commit&gt;
  &lt;/entry&gt;
  </code></pre>
  
  <p>I can get everything else easily enough, just not seeing how to get an attribute that is not at the top level of an entry.</p>
  
  <p>Thanks (and apologies if this is a noob question).</p>