I have a String, which contains an XML with a structure similar to this:
<TAG0>
<TAG1>
<TAG2>valor1</TAG2>
</TAG1>
<TAG1>
<TAG2>valor2</TAG2>
</TAG1>
</TAG0>
In the case I have tags with the same name, which are repeated in the XML body, like a sale, which contains several items. The String with XML is with plain text without spaces. Ex.:
String VARIAVEL = "<TAG0><TAG1><TAG2>valor1</TAG2></TAG1><TAG1><TAG2>valor2</TAG2></TAG1></TAG0>"
What I have to do, as in this example, is to retrieve the values of the tags "TAG2", knowing that I can have N tags as "TAG1". The real case is to retrieve all CFOPs from items in an NFe.