<?xml version = "1.0" encoding = "UTF-8"?>
<applications >
<application >
<journalNumber > 1 < /journalNumber >
</application >
<application >
<journalNumber > 2</journalNumber>
</application >
</applications >
etxml = etree.parse(afile)
root = etxml.getroot()
value = root.xpath("//*[local-name() = '{0}']".format("application"))
<Element {http://zakupki.gov.ru/oos/types/1}application at 0x16568142d48>
etree.tostring(value)
value.text
<?xml version = "1.0" encoding = "UTF-8"?>
<applications>
<application>
<journalNumber>1</journalNumber>
</application>
<application>
<journalNumber>2</journalNumber>
</application>
</applications>
from lxml import etree
etxml = etree.parse('test.xml')
root = etxml.getroot()
values = root.xpath("//*[local-name() = 'journalNumber']")
for value in values:
print('XML: ', etree.tostring(value, encoding='unicode'))
print('Text: ', value.text)
XML: <journalNumber>1</journalNumber>
Text: 1
XML: <journalNumber>2</journalNumber>
Text: 2