def METHOD_NAME(self, html_str):
    """
    Standardize the given HTML string for a consistent comparison.
    Assumes the HTML is valid XML.
    """
    # We wrap it in <x></x> so that the given HTML string doesn't need a single root element.
    parser = etree.XMLParser(remove_blank_text=True)
    parsed = etree.parse(StringIO(f"<x>{html_str}</x>"), parser=parser).getroot()
    return etree.tostring(parsed, pretty_print=False, encoding="UTF-8")[3:-3]