Is it possible to extract complete blocks of XML text from an XML file using Python? I am using ElementTree with Python to extract tags and values from XML, in order to compare 2 XML files. But is it possible to extract the whole text of an XML block?
For example:
<stats>
<player>
<name>Luca Toni</name>
<matches>47</matches>
<goals>16</goals>
<WC>yes</WC>
</player>
<player>
<name>Alberto Gilardino</name>
<matches>57</matches>
<goals>19</goals>
<WC>yes</WC>
</player>
<player>
<name>Mario Balotelli</name>
<matches>36</matches>
<goals>14</goals>
<WC>yes</WC>
</player>
</stats>
Is it possible to extract one particular complete block (), as given below, from the above XML using python (ElementTree)?
<player>
<name>Luca Toni</name>
<matches>47</matches>
<goals>16</goals>
<WC>yes</WC>
</player>