Python script to read LANDSAT XML metafile
<p>I need to obtain the scene ID for several Landsat images. The metadata for the images is contained in an xml file:</p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;searchResponse xsi:schemaLocation="http://upe.ldcm.usgs.gov/schema/metadata
http://earthexplorer.usgs.gov/EE/metadata.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
xmlns="http://upe.ldcm.usgs.gov/schema/metadata"&gt;
    &lt;metaData&gt;
        &lt;browseAvailable&gt;Y&lt;/browseAvailable
        &lt;browseURL&gt;http://earthexplorer.usgs.gov/browse/tm/146/41/1998/LT51460411998300XXX01.jpg&lt;/browseURL&gt; 
        &lt;sceneID&gt;LT51460411998300XXX01&lt;/sceneID&gt; 
        &lt;sensor&gt;LANDSAT_TM&lt;/sensor&gt; 
        &lt;acquisitionDate&gt;1998-10-27&lt;/acquisitionDate&gt; 
        &lt;dateUpdated&gt;2012-07-31&lt;/dateUpdated&gt; 
        &lt;path&gt;146&lt;/path&gt; 
        &lt;row&gt;41&lt;/row&gt; 
        &lt;...&gt;
     &lt;/metaData&gt;
     &lt;metaData&gt;
        &lt;sceneID&gt;LT51460411998300XXX01&lt;/sceneID&gt; 
        &lt;sensor&gt;LANDSAT_TM&lt;/sensor&gt; 
        &lt;acquisitionDate&gt;1998-10-27&lt;/acquisitionDate&gt; 
        &lt;dateUpdated&gt;2012-07-31&lt;/dateUpdated&gt; 
        &lt;path&gt;146&lt;/path&gt; 
        &lt;row&gt;41&lt;/row&gt; 
        &lt;...&gt;
    &lt;etc etc&gt;
</code></pre>

<p>The following code will list all the nodes in metaData (browseAvailable, browseURL, sceneID) but what I really want to do is just get a list of sceneID.</p>

<pre><code>#!/usr/bin/python

#import os
#import sys
from xml.dom.minidom import parse

import xml.etree.ElementTree as ET
#import grass.script as grass

tree = ET.parse('C:/Users/Simon/Documents/tif/Metadata/metadata_test1.xml')
root = tree.getroot()

for metadata in root:  
    for data in metadata:          
    sceneID = data.text
        grass.message('data -&gt; %s' % (sceneID))
</code></pre>

<p>I've tried using the tools described on the Python xml.etree.ElementTree with no success. Could anyone help me adapt the code above to return sceneID only?</p>
