Store encrypted password in xml
<p>I am storing a user name and password in an .xml file with the password encrypted.  When I try to add another username and password, it overwrites the first. How can I append the append the existing file?</p>

<pre><code>$username = "user"
$password = "password1" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $username,($password | ConvertTo-SecureString)
$cred | Export-Clixml C:\file.xml
</code></pre>

<p>I am having difficulty understanding the answer provided. I have tried several different values, what should I be using in place of Node?</p>

<pre><code>&lt;Objs Version="1.1.0.1"xmlns="http://schemas.microsoft.com/powershell/2004/04"&gt;
  &lt;Obj RefId="0"&gt;
    &lt;TN RefId="0"&gt;
      &lt;T&gt;System.Management.Automation.PSCredential&lt;/T&gt;
      &lt;T&gt;System.Object&lt;/T&gt;
    &lt;/TN&gt;
    &lt;ToString&gt;System.Management.Automation.PSCredential&lt;/ToString&gt;
    &lt;Props&gt;
      &lt;S N="UserName"&gt;Tom&lt;/S&gt;
      &lt;SS N="Password"&gt;01000000d08c9ddf0115d1118c7a00c04fc297eb01000000fbc3e29e463de248a4643396e70cd6670000000002000000000003660000c0000000100000005f32bf40a436abd21b2855a28a7930f10000000004800000a000000010000000f4d23943a843968368a273547091233b1800000061921de936aa6f7952ef38c53de64f22dcad44e75836a01514000000d50a8b31c7c3a242e82f3c8c1c1105f1431f2a01&lt;/SS&gt;
    &lt;/Props&gt;
  &lt;/Obj&gt;
&lt;/Objs&gt;
</code></pre>