title: For loop can't generate xml elements with varying contents
body: <p>I was trying to make a ProPresenter 6 Presentation file (or <code>.pro6</code>) generator from either a short or long string input. For some reason, the for loop did not do its job correctly. The for loop should generate another xml tag named &quot;<code>RVDisplaySlide</code>&quot; with the same tags and contents parsed from a template <code>.pro6</code> file, then replaces the contents with the string input.</p>
  <p>For a short string input, it works as it would generate one &quot;slide&quot; tag. However, for long string inputs, which would get split to a list of &quot;fit-able&quot; strings for the &quot;textbox element&quot;, it generated the same tags <strong>WITH THE SAME</strong> content as the first one did.</p>
  <p>The full code can be found in this hastebin link: <a href="https://www.toptal.com/developers/hastebin/hidefogizi.py" rel="nofollow noreferrer">https://www.toptal.com/developers/hastebin/hidefogizi.py</a></p>
  <p>For now, to simplify how the problem looked like, I commented the codeblock that would generate the content and left the code that <strong>should</strong> generate different uuid values to the elements. The output is similar still.</p>
  <p>Here's an example of what I meant:</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; a = ToPro6(&quot;&quot;&quot;[Connection Terminated]
  I'm sorry to interrupt you, Elizabeth, if you still even remember that name, but I'm afraid you've been misinformed. You are not here to receive a gift, nor have you been called here by the individual you assume, although, you have indeed been called. You have all been called here, into a labyrinth of sounds and smells, misdirection and misfortune. A labyrinth with no exit, a maze with no prize. You don't even realize that you are trapped. Your lust for blood has driven you in endless circles, chasing the cries of children in some unseen chamber, always seeming so near, yet somehow out of reach, but you will never find them. None of you will. This is where your story ends.
  
  And to you, my brave volunteer, who somehow found this job listing not intended for you, although there was a way out planned for you, I have a feeling that's not what you want. I have a feeling that you are right where you want to be. I am remaining as well. I am nearby. This place will not be remembered, and the memory of everything that started this can finally begin to fade away, as the agony of every tragedy should.
  
  And to you monsters trapped in the corridors, be still and give up your spirits. They don't belong to you. For most of you, I believe there is peace and perhaps more waiting for you after the smoke clears. Although, for one of you, the darkest pit of Hell has opened to swallow you whole, so don't keep the devil waiting, old friend.
  
  My daughter, if you can hear me, I knew you would return as well. It's in your nature to protect the innocent. I'm sorry that on that day, the day you were shut out and left to die, no one was there to lift you up into their arms the way you lifted others into yours, and then, what became of you. I should have known you wouldn't be content to disappear, not my daughter. I couldn't save you then, so let me save you now. It's time to rest - for you, and for those you have carried in your arms. This ends for all of us.
  
  [End Communication]&quot;&quot;&quot;, &quot;fnaf6_speech&quot;)
  
  &gt;&gt;&gt; a.save(&quot;..&quot;)
  &lt;Element 'array' at 0x0000018847E9BA10&gt;
  'Succeed'
  </code></pre>
  <p>XML output:</p>
  <pre class="lang-xml prettyprint-override"><code>...
      &lt;RVSlideGrouping name=&quot;&quot; color=&quot;1 1 1 0&quot; uuid=&quot;709FF810-7A39-46AD-8A4E-03E592A0AFB1&quot;&gt;
        &lt;array rvXMLIvarName=&quot;slides&quot;&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
          &lt;RVDisplaySlide backgroundColor=&quot;0 0 0 1&quot; highlightColor=&quot;&quot; drawingBackgroundColor=&quot;false&quot; enabled=&quot;true&quot; hotKey=&quot;&quot; label=&quot;&quot; notes=&quot;&quot; UUID=&quot;0380C4D4-FD26-4768-9612-28AEE0C05894&quot; chordChartPath=&quot;&quot; /&gt;
        &lt;/array&gt;
      &lt;/RVSlideGrouping&gt;
  ...
  </code></pre>
  <p>As you can see, it generated the <strong>same</strong> uuid for each element. Is there a way to fix this?</p>