title: Select node based on child node value in Web.config Transform
body: <p>I have the following XML in my web config and I would like to select an attribute for removal using web.config transforms, but I would like to select the element for removal based on the value of one of the child elements.</p>
  
  <p>My web.config is something like this:</p>
  
  <pre><code>&lt;configuration&gt;
     &lt;sitecore&gt;
         &lt;scheduling&gt;
            &lt;agent type="Sitecore.Tasks.DatabaseAgent"&gt;
               &lt;param desc="database"&gt;core&lt;/param&gt;
            &lt;/agent&gt;
            &lt;agent type="Sitecore.Tasks.DatabaseAgent"&gt;
               &lt;param desc="database"&gt;master&lt;/param&gt;
            &lt;/agent&gt;
         &lt;/scheduling&gt;
      &lt;/sitecore&gt;
   &lt;/configuration&gt;
  </code></pre>
  
  <p>I have tried the following to try to select the second agent element for deletion based on the child element <code>&lt;param desc="database"&gt;master&lt;/param&gt;</code> but with no success.</p>
  
  <pre><code>&lt;configuration&gt;
     &lt;sitecore&gt;
         &lt;scheduling&gt;
            &lt;!-- Attempt 1 --&gt;
            &lt;agent type="Sitecore.Tasks.DatabaseAgent"
                   xdt:Transform="Remove"
                   xdt:Locator="XPath(configuration/sitecore/scheduling/agent/param[text()='master'])"/&gt;
  
            &lt;!-- Attempt 2 --&gt;
            &lt;agent type="Sitecore.Tasks.DatabaseAgent"
                   xdt:Transform="Remove"&gt;
               &lt;param desc="database"
                      xdt:Locator="XPath([text()='master'])"/&gt;
            &lt;/agent&gt;
         &lt;/scheduling&gt;
      &lt;/sitecore&gt;
   &lt;/configuration&gt;
  </code></pre>