title: Namespace handling in Groovys XmlSlurper
body: <p>The situation:</p>
  
  <pre><code>def str = """
    &lt;foo xmlns:weird="http://localhost/"&gt;
      &lt;bar&gt;sudo &lt;/bar&gt;
      &lt;weird:bar&gt;make me a sandwich!&lt;/weird:bar&gt;
    &lt;/foo&gt;
  """
  def xml = new XmlSlurper().parseText(str)
  println xml.bar
  </code></pre>
  
  <p>The output of this snippet is </p>
  
  <pre><code># sudo make me a sandwich!
  </code></pre>
  
  <p>It seems like the parser merges the contents of <code>&lt;bar&gt;</code> and <code>&lt;weird:bar&gt;</code>.</p>
  
  <p>Is this behavior desired and if yes, how can I avoid this and select only <code>&lt;bar&gt;</code> or <code>&lt;weird:bar&gt;</code>?</p>