title: .Remove(); does not Remove and .Save(); does set asmv infront of every Node
body: <p>as I said in the Title:</p>
  
  <p><code>.Remove();</code> does not Remove</p>
  
  <p>and </p>
  
  <p><code>.Save();</code> does set <code>asmv2</code> infront of every node</p>
  
  <p>Code:</p>
  
  <pre><code>private void DeleteXmlPopulates()
      {
          string filePath = "C:\\Example\\Example.exe.manifest"
          var xml = XElement.Load(filePath);
          xml.Descendants().Where(x =&gt; x.Name == "dependentAssembly" &amp;&amp; (string)x.Attribute("dependencyType") == "install").Remove();
          xml.Save(filePath);
      }
  </code></pre>
  
  <p>Xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2"&gt;
  &lt;asmv1:assemblyIdentity name="Example.exe" version="6.1.0.0" publicKeyToken="7f785aa0b92a51a3" language="neutral" processorArchitecture="x86" type="win32" /&gt;
  &lt;description asmv2:iconFile="Example.ico" xmlns="urn:schemas-microsoft-com:asm.v1" /&gt;
  &lt;application /&gt;
  &lt;entryPoint&gt;
  &lt;assemblyIdentity name="Example" version="6.1.0.14132" language="neutral" processorArchitecture="x86" /&gt;
  &lt;commandLine file="Example.exe" parameters="" /&gt;
  &lt;/entryPoint&gt;
  &lt;trustInfo&gt;
  &lt;security&gt;
  &lt;applicationRequestMinimum&gt;
  &lt;PermissionSet Unrestricted="true" ID="Custom" SameSite="site" /&gt;
  &lt;defaultAssemblyRequest permissionSetReference="Custom" /&gt;
  &lt;/applicationRequestMinimum&gt;
  &lt;requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"&gt;    
  &lt;requestedExecutionLevel level="asInvoker" uiAccess="false" /&gt;
    &lt;/requestedPrivileges&gt;
  &lt;/security&gt;
  &lt;/trustInfo&gt;
  &lt;dependency&gt;
  &lt;dependentOS&gt;
    &lt;osVersionInfo&gt;
      &lt;os majorVersion="5" minorVersion="1" buildNumber="2600" servicePackMajor="0" /&gt;
    &lt;/osVersionInfo&gt;
  &lt;/dependentOS&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
  &lt;dependentAssembly dependencyType="preRequisite"&gt;
  &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
  &lt;dependentAssembly dependencyType="install"&gt;
  &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>there is a comment in the Xml file : <code>UAC Manifest Options If you want to change the Windows User Account Control level replace the requestedExecutionLevel node with one of the following. &lt;requestedExecutionLevel  level="asInvoker" uiAccess="false" /&gt; &lt;requestedExecutionLevel  level="requireAdministrator" uiAccess="false" /&gt; &lt;requestedExecutionLevel  level="highestAvailable" uiAccess="false" /&gt; If you want to utilize File and Registry Virtualization for backward compatibility then delete the requestedExecutionLevel node.</code></p>
  
  <p>How the Code shall look like: (just the dependency part , the remaining Part shall be the same)</p>
  
  <pre><code>&lt;dependency&gt;
  &lt;dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true"&gt;
  &lt;/dependentAssembly&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>How the Code does look like: (just the dependency part , the remaining Part has asmv2 infront of every node)</p>
  
  <pre><code>&lt;asmv2:dependency&gt;
  &lt;asmv2:dependentAssembly dependencyType="preRequisite"&gt;
  &lt;/asmv2:dependentAssembly&gt;
  &lt;/asmv2:dependency&gt;
  
  &lt;asmv2:dependency&gt;
  &lt;asmv2:dependentAssembly dependencyType="install" &gt;
  &lt;/asmv2:dependency&gt;
  &lt;/asmv2:dependentAssembly&gt;
  </code></pre>
  
  <p>Ok, the more important question (respectively the question We shall try to answer) is why does <code>.Save();</code> set <code>asmv2:</code> infront of every node?
  If thats normal with the Method <code>.Save();</code>then I'm surprised because the File cannot be oppened anymore with <a href="http://msdn.microsoft.com/de-de/library/xhctdw55(v=vs.110).aspx" rel="nofollow">MageUI.exe</a></p>
  
  <p>How could I solve this Problem or avoid it?</p>
  
  <p>I would appreciate constructive criticism :)</p>