from PyQt5.QtXml import QDomDocument doc = QDomDocument()
from PyQt5.QtXml import QDomDocument doc = QDomDocument() xml_file = open("sample.xml") doc.setContent(xml_file.read()) xml_file.close()
from PyQt5.QtXml import QDomDocument doc = QDomDocument() xml_file = open("sample.xml") doc.setContent(xml_file.read()) xml_file.close() root = doc.documentElement() print(root.tagName())This code parses the XML document loaded in Example 2 and prints the root element's tag name. In this case, it would print the root element's tag name of "bookstore". Overall, the PyQt.QtXml package library provides a useful module for working with XML documents in Python QGIS.