title: Web.config transformation: how to apply a transformation to all node matching a Locator expression?
body: <p>I've recently discovered the web.config automatic transformation in the web deploy tool of visual studio 2010.
  It's working well, but I have a scenario I can't seem to get working.
  Assume I have the following root Web.config</p>
  
  <pre><code>&lt;services&gt;
    &lt;service name="Service1"&gt;
      &lt;endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
        contract="Service1" /&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
    &lt;service name="Service2"&gt;
      &lt;endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
        contract="Service2" /&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
    &lt;service name="Service3"&gt;
      &lt;endpoint address="" binding="customBinding" bindingConfiguration="LargeBufferBinding"
        contract="Service3" /&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  </code></pre>
  
  <p>For my Web.Release.config, I want <strong>all the endpoint nodes with a binding of mexHttpBinding</strong> to be removed.</p>
  
  <p>I've used the following in my Web.Release.config: </p>
  
  <pre><code>&lt;services&gt;
    &lt;service&gt;
      &lt;endpoint binding="mexHttpBinding" xdt:Locator="Match(binding)" xdt:Transform="Remove" /&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  </code></pre>
  
  <p>However, this will only remove the first match, in the Service1, but not the following ones.
  I've tried various way of locating the node, on the endpoint and service node, but only the first match ever gets replaced.</p>
  
  <p>Is there a way to get all the <code>&lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;</code> to be removed ?</p>
  
  <p>Thanks.</p>