<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def xml_equal(xml_file1, xml_file2):
 """ Parse xml and convert to a canonical string representation so we don't have to worry about semantically meaningless differences """

    def canonical(xml_file):
        # poor man's canonicalization, since we don't want to install
        # external packages just for unittesting
        s = et.tostring(et.parse(xml_file).getroot()).decode("UTF-8")
        s = re.sub("[\n|\t]*", "", s)
        s = re.sub("\s+", " ", s)
        s = "".join(sorted(s)).strip()
        return s

    return canonical(xml_file1) == canonical(xml_file2)