title: powershell - create template from string instead of file
body: <p>I have the following powershell code. It basically creates a template, that I then use to populate with XML data.</p>
  
  <pre><code>$template = @'
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;list&gt;
      &lt;details&gt;
          &lt;cj&gt;&lt;/cj&gt;
          &lt;jn&gt;&lt;/jn&gt;
          &lt;en&gt;&lt;/en&gt;
          &lt;st&gt;&lt;/st&gt;
          &lt;et&gt;&lt;/et&gt;
      &lt;/details&gt;
  &lt;/list&gt;
  '@
  
  $template | Out-File template.xml -encoding UTF8
  
  $xml = New-Object xml
  $xml.Load("template.xml")
  </code></pre>
  
  <p>It works fine, but I was wondering if there was a cleaner way of doing this that doean't involve exporting it to a file and then loading that file back in.</p>
  
  <p>e.g. is there a way of passing <code>$template</code> directly to the <code>$xml</code> (similar to <code>$xml.Load($template)</code> - which doesn't work) </p>
  
  <p>I've had a look around the web, but can't find anything to help - am I just looking in the wrong places? or can it not be done?</p>