Correctly parse xml in python?

Hello!
Guys, tell me how correctly to steam xml document using PYTHON?
I would like to deal in practice with the review.
Here is my document defaultVar.xml

<?xml version = "1.0" encoding = "UTF-8"?>
<repository xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns = "http://www.tibco.com/xmlns/repo/types/2002">
<globalVariables>
<globalVariable>
<name>Host</name>
<value>10.64.13.131:1576</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>String</type>
<modTime>1559628965605</modTime>
</globalVariable>
<globalVariable>
<name>MaxConnections</name>
<value>10</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>Integer</type>
<modTime>1559628965605</modTime>
</globalVariable>
<globalVariable>
<name>SID</name>
<value>taffy</value>
<deploymentSettable>true</deploymentSettable>
<serviceSettable>false</serviceSettable>
<type>String</type>
<modTime>1559628965605</modTime>
</globalVariable>
</globalVariables>
</repository>


Try to use this way (print a tag with the name of the SID and all its attributes):
import xml.etree.ElementTree as ET
tree = ET.parse("C:/Users/admin/Documents/Python/defaultVars.xml")
for element in tree.findall("repository/globalVariables/globalVariable"):
name = element.find("SID")
print(element.tag name.text, element.attrib)


Retained as parcing.py
Start python.exe parcing.py using cmd
The execution result is empty.
Can you tell why?
March 23rd 20 at 19:32
2 answers
March 23rd 20 at 19:34
Solution
I would take the xml.dom.minidom is an xml.etree.ElementTree , because he tagged with best friends.

import xml.dom.minidom

doc = xml.dom.minidom.parse("test.xml")
data ={}
for info in doc.getElementsByTagName("globalVariable"):
 name = str(info.getElementsByTagName("name")[0].firstChild.data)
 value = str(info.getElementsByTagName("value")[0].firstChild.data)
data[name]=value
print(data)

the result will be:
{'Host': '10.64.13.131:1576', 'SID': 'taffy', 'MaxConnections': '10'}
March 23rd 20 at 19:36
I site map is dismantled in BS4, very quickly and in three rows)

Find more questions by tags Python