In other words, in the following web.config xml, I want to remove all elements with a type attribute that starts with 'Elmah.'
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
I have tried several combinations and structures of the basic transform, with various errors,
<add xdt:Locator="XPath([starts-with(@type,'Elmah.')" xdt:Transform="Remove"/>
before giving up and just removing the whole httpModules element, because no XPath is needed for that.
Have you tried removing each module individually?