I'm trying to get values of in to a list. I need to get a list with this values new_values = ['a','b'] using xpath
import xml.etree.ElementTree as ET
parse = ET.parse('xml.xml')
[ record.find('events').text for record in parse.findall('.configuration/system/') ]
xml.xml file
<rpc-reply>
<configuration>
<system>
<preference>
<events>a</events>
<events>b</events>
</preference>
</system>
</configuration>
</rpc-reply>
The output of my python code is a list only with one value - ['a'], but i need a list with a and b.