title: replacing text in multiple elements in an XML file
body: <p>I have multiple endpoints in an XML doc where I am trying to replace some of the address strings. I don't want to replace the same text in the entire doc just in the endpoints. So I have tried to narrow it down and tried different ways but I cannot get it to work.</p>
  
  <p>This is my most recent attempt. Am I missing something incredibly obvious here?</p>
  
  <pre><code>$xmlDoc = [XML](Get-Content "$path\filename.exe.config")
  
  foreach ($i in $xmlDoc.configuration.'system.serviceModel'.client.endpoint) {
    if ($i.address -match "bla") {
      $i.address -replace "bla", "foo"
    }
  }
  
  $xmlDoc.Save("$path\filename.exe.config")
  </code></pre>