def package_and_class_tags(self, cov: Coverage) -> Iterator[tuple[str, dict[str, Any]]]:
        """Run an XML report on `cov`, and get the package and class tags."""
        cov.xml_report()
        dom = ElementTree.parse("coverage.xml")
        for node in dom.iter():
            if node.tag in ('package', 'class'):
                yield (node.tag, {a:v for a,v in node.items() if a in ('name', 'filename')})
Run an XML report on `cov`, and get the package and class tags.
tests/test_xml.py