title: How to import an XML file into an Excel XLS file template using Python?
body: <p>I have an Excel template file which has columns as defined within an XML. Manually I can right click over the template then XML > import, and select the XML file, and finally save the file.</p>
  
  <p>How can I <strong>perform this task automatically programming it in Python</strong>?</p>
  
  <p>Example of XML file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;DCPowerFlow&gt;
      &lt;branches&gt;
          &lt;branch&gt;
              &lt;busFrom name="bus_one" number="1" /&gt;
              &lt;busTo name="bus_two" number="2" /&gt;
              &lt;id&gt;1&lt;/id&gt;
              &lt;rateA&gt;1000&lt;/rateA&gt;
              &lt;resultPowerFlow&gt;
                  &lt;probOverFlow&gt;0.0&lt;/probOverFlow&gt;
                  &lt;maxOverFlow&gt;800&lt;/maxOverFlow&gt;
              &lt;/resultPowerFlow&gt;
          &lt;/branch&gt;
          &lt;branch&gt;
              &lt;busFrom name="bus_two" number="2" /&gt;
              &lt;busTo name="bus_three" number="3" /&gt;
              &lt;id&gt;1&lt;/id&gt;
              &lt;rateA&gt;1200&lt;/rateA&gt;
              &lt;resultPowerFlow&gt;
                  &lt;probOverFlow&gt;0.1&lt;/probOverFlow&gt;
                  &lt;maxOverFlow&gt;1300&lt;/maxOverFlow&gt;
              &lt;/resultPowerFlow&gt;
          &lt;/branch&gt;
      &lt;/branches&gt;
  &lt;/DCPowerFlow&gt;
  </code></pre>
  
  <p>To check for the manual task:</p>
  
  <ol>
  <li>Save the above example as an XML file.</li>
  <li>In order to create the Excel XLS template you can simply open the above XML example with Excel, ensure no data is on the template (delete data if within the import you added any) and save the file as XLS.</li>
  <li>Import the example XML file. Right click on the Excel template file created, then XML > Import, and select the XML example file.</li>
  <li>Save Template with data as a new XLS.</li>
  </ol>
  
  <p>So what I need to do is to <strong>automate steps 3 and 4</strong>.</p>