def xml_data():
    root = ET.parse('opidea_2.xml')
logentries = root.findall('logentry')
content = ''
for logentry in logentries:
    date = logentry.find('date').text
content += date + '\n '
msg = logentry.find('msg')
if msg is not None:
    content += '   Comments: \n        ' + msg.text + '\n\n'
else:
    content += 'No comment made.'
print(content)
if __name__ == '__main__':
    xml_data()
Python, XML AttributeError: объект «NodeList» не имеет атрибута «firstChild»