import xmltodict import pprint import pandas as pd # Open the file and read the contents with open('test_data.tcx', 'r', encoding='utf-8') as file: my_xml = file.read() # Use xmltodict to parse and convert the # XML document my_dict = xmltodict.parse(my_xml) df = pd.DataFrame.from_dict(my_dict) df.name = "test" # Print the dictionary #pprint.pprint(my_dict, indent=2) print("DataFrame name: ", df.name) print(df)