Check out my Medium post which gives more context on the problem I was solving and the code itself. Here are links to view the notebooks on Google's Colab in case GitHub refuses to render the notebooks:
britt-allen/ecfr_xml_parsing
Parsing CFR Title 16 Commercial Practices from the GPO's Bulk Data Repository
Jupyter Notebook