title: How to extract the connection.username and replace in XML file
body: <p>I have an XML file to edit using PowerShell.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;InitFile version="1.0"&gt;
      &lt;SecureReadOnlyFields value="true"/&gt;
      &lt;file-browser&gt;
          &lt;allow-upload value="true"/&gt;
          &lt;root url="D:\Temp\"/&gt;
          &lt;folder url="pa_wf"/&gt;
          &lt;folder url="fsa"/&gt;
          &lt;folder url="CG"/&gt;
      &lt;/file-browser&gt;
      &lt;HibernateConfigurations&gt;
          &lt;HibernateDefaultSecurityKey value="ATF"/&gt;
          &lt;HibernateConfiguration name="USER_AUT_FRA_WFSE"&gt;
              &lt;session-factory&gt;
                  &lt;property name="connection.driver_class"&gt;xxxxxx&lt;/property&gt;
                  &lt;property name="connection.url"&gt;xxxxx&lt;/property&gt;
                  &lt;property name="connection.username"&gt;USER_AUT&lt;/property&gt;
              &lt;/session-factory&gt;
  </code></pre>
  
  <p>Code to read the XML file:</p>
  
  <pre class="lang-bsh prettyprint-override"><code>$inixml = (Get-Content -Path D:\init.xml)
  $upinit = $inixml | ConvertTo-Xml
  $node = $upinit.SelectNodes("//property")
  </code></pre>
  
  <p>The last line in code is not giving any O/P. Edit the line containing "connection.username" using PowerShell with USER_AUT_PAR instead of USER_AUT.</p>