def compare_xml(expected: str, actual: str, actual_extra: bool = False) -> None:
    """Specialized compare function for our XML files."""
    source_path = coverage.files.relative_directory().rstrip(r"\/")

    scrubs=[
        (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'),
        (r' version="[-.\w]+"', ' version="VERSION"'),
        (r'<source>\s*.*?\s*</source>', '<source>%s</source>' % re.escape(source_path)),
        (r'/coverage\.readthedocs\.io/?[-.\w/]*', '/coverage.readthedocs.io/VER'),
    ]
    compare(expected, actual, scrubs=scrubs, actual_extra=actual_extra)
Specialized compare function for our XML files.
tests/test_xml.py