I am using [MSBuild](http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx) and [MSBuild Community Tasks](http://msbuildtasks.tigris.org/) (using XMLUpdate and [XMLMassUpdate](http://blogs.microsoft.co.il/blogs/dorony/archive/2008/01/18/easy-configuration-deployment-with-msbuild-and-the-xmlmassupdate-task.aspx)) to update various sections of my Web.config one thing has me stumped though. If I have: 

```
<configuration>
    <nlog throwExceptions="true" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <targets>
            <target name="file" xsi:type="File" fileName="${logDirectory}\SomeLog.log" layout="${message}"/>
        </targets>
    </nlog> 
</configuration>

```

and I try to replace the `fileName` of the `target` 

```
<XmlUpdate XmlFileName="$(BuildDir)\Builds\%(Configuration.Identity)\_PublishedWebsites\Presentation\Web.config"
           XPath="//configuration/nlog/targets/target[@fileName]"
           Value="${logDirectory}\SomeLog_%(Configuration.Identity).log" />

```

It reports as being unable to find anything to update, so my question is how can I get the filename attribute to updated?

---

**EDIT:** Could this be a case of namespace clashes as the NLog section defines its own namespace?

---

**UPDATE**: The posted answer declaring the name space does not work.