title: How to update an XML document with Ant
body: <p>My goal is to simply update the "lastmod" node in a simple sitemap xml document:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;
      &lt;url&gt;
          &lt;loc&gt;http://www.example.com/&lt;/loc&gt;
          &lt;lastmod&gt;2005-01-01&lt;/lastmod&gt;
      &lt;/url&gt;
  &lt;/urlset&gt; 
  </code></pre>
  
  <p>I want to do this as part of my deploy ant script so I am using the Ant task <a href="http://www.oopsconsultancy.com/software/xmltask/" rel="noreferrer">XMLTask</a>. Here is my ant target:</p>
  
  <pre><code>&lt;target name="update-sitemap" description="update the update date"&gt;
      &lt;xmltask source="war/sitemap.xml" dest="war/newsitemap.xml" report="true"&gt;
          &lt;replace path="/urlset/url/lastmod/text()" withText="new text"/&gt;
      &lt;/xmltask&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>Unfortunately, my xpath fails to match anything:</p>
  
  <pre><code>[xmltask] TextAction(new text) (/urlset/url/lastmod/text()) failed to match
  </code></pre>
  
  <p>I have also tried the following xpath queries with no luck:</p>
  
  <pre><code>//lastmod/text()
  /urlset[@*]/url/lastmod/text()
  /urlset[@xmlns]/url/lastmod/text()
  </code></pre>
  
  <p>I have however discovered that if I manually remove the namespace attribute from the urlset node in my source file, everything works ok.
  Is this a bug in XMLTask or am I doing something wrong?</p>