...and your 100% sure your xpath is correct. It's probably that there is a namespace defined. All you need to do is define the namespace under the xmlpoke element and prefix your element names with the namespace prefix. Check it:

web.config:

xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
 
   
 

NAnt:


   
                     file="D:\Temp\web.config"
             xpath="/ns:configuration/ns:appSettings/ns:add[@key='SomeSetting']/@value"
             value="SomeValue">
                 
                      http://schemas.microsoft.com/.NetConfiguration/v2.0" />