'Using only Built-In Modules to Create Dictionary from Two Deep, Difficult XMLs

I'm working on a closed network with only default Python 3.10.4 and for now I can't transfer over any new modules. I have two XMLs of the structure:

<object>
    <param-sets>
         <param-line>
              <spec1>text
              <spec2>text
               <spec3>
                    <min>text
                    <max>text
               <spec4>text
<object>
etc

with multiple repeating objects. Each file will have the same objects, but some different param-lines. My goal is to save to a CSV a non-repeating list of the param-lines and only some of their specs, but the same ones for each, along with their text. I've considered a chainmap but am finding obstacles in:

  1. the "-" within some element names
  2. some specs under the same parent param-line having the same name, i.e. multiple max's and min's


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source