51
51
encoding = get_file_encoding(file_path)['encoding']
52
52
# Open file with detected encoding and remove encoding declaration
53
53
text = file_path.read_text(encoding=encoding)
54
55
text = re.sub(r'.+\?>\n', '', text)
56
57
tree = etree.fromstring(text, parser=etree.XMLParser(recover=True))