title: How do I create new element of XML automatically file in PowerShell?
body: <p>I have a text file with this content:</p>
  
  <pre><code>123asdf
  abdfeef
  22343sf
  dfafdsf
  </code></pre>
  
  <p>The content of this file is changing.</p>
  
  <p>I want to create an xml file, where one element contains the text file content.</p>
  
  <p>I tried this, but all the content is in the same element:</p>
  
  <pre><code>$Getfile = Get-Content .\DeleteFile.txt
  $TimeStamp = [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId(
          (Get-Date), 'Taipei Standard Time')
  $delete_file = @"
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;Handling&gt;
          &lt;Deleted&gt;
              &lt;1&gt;$Getfile&lt;/1&gt;
          &lt;/Deleted&gt;
          &lt;TimeStamp&gt;$TimeStamp&lt;/TimeStamp&gt;
      &lt;/Handling&gt;
  "@
  $delete_file | Out-File .\DeleteFile.xml
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Handling&gt;
      &lt;Deleted&gt;
          &lt;1&gt;123asdf abdfeef 22343sf dfafdsf&lt;/1&gt;
      &lt;/Deleted&gt;
      &lt;TimeStamp&gt;12/04/2019 17:49:06&lt;/TimeStamp&gt;
  &lt;/Handling&gt;
  </code></pre>
  
  <p>My expectation was that the output would be like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Handling&gt;
      &lt;Deleted&gt;
          &lt;1&gt;123asdf&lt;/1&gt;
          &lt;2&gt;abdfeef&lt;/2&gt;
          &lt;3&gt;22343sf&lt;/3&gt;
          &lt;4&gt;dfafdsf&lt;/4&gt;
      &lt;/Deleted&gt;
      &lt;TimeStamp&gt;12/04/2019 17:49:06&lt;/TimeStamp&gt;
  &lt;/Handling&gt;
  </code></pre>
  
  <p>Can anyone help me please?</p>