title: xpath expression in findnodes() returning empty nodelist
body: <p>XML:</p>
  
  <pre><code>&lt;zoo xmlns="http://www.zoo.com" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.zoo.com employee.xsd"&gt;
  
  &lt;area id="1" posizione="nord" nome="scimmie"&gt;
      &lt;animale&gt;
          &lt;nome&gt;Gigi&lt;/nome&gt;
          &lt;sesso&gt;Male&lt;/sesso&gt;
          &lt;eta&gt;3&lt;/eta&gt;
      &lt;/animale&gt;
  
      &lt;animale&gt;
          &lt;nome&gt;Gigia&lt;/nome&gt;
          &lt;sesso&gt;Female&lt;/sesso&gt;
          &lt;eta&gt;2&lt;/eta&gt;
      &lt;/animale&gt;
  &lt;/area&gt;
  
  &lt;area id="2" posizione="nord" nome="giraffe"&gt;
      &lt;animale&gt;
          &lt;nome&gt;Giro&lt;/nome&gt;
          &lt;sesso&gt;Male&lt;/sesso&gt;
          &lt;eta&gt;6&lt;/eta&gt;
      &lt;/animale&gt;
  
      &lt;animale&gt;
          &lt;nome&gt;Gira&lt;/nome&gt;
          &lt;sesso&gt;Female&lt;/sesso&gt;
          &lt;eta&gt;5&lt;/eta&gt;
      &lt;/animale&gt;
  &lt;/area&gt;
  &lt;/zoo&gt;
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>my $parser = XML::LibXML-&gt;new;
  my $doc = $parser-&gt;parse_file("../xml/animals.xml");
  my $root = $doc-&gt;getDocumentElement();
  
  my $new_animal = $doc-&gt;createElement("animale");
  
  my $name_element = $doc-&gt;createElement("nome");
  $name_element-&gt;appendTextNode($name);
  
  my $gender_element = $doc-&gt;createElement("sesso");
  $gender_element-&gt;appendTextNode($gender);
  
  my $age_element = $doc-&gt;createElement("eta");
  $age_element-&gt;appendTextNode($age);
  
  $new_animal-&gt;appendChild($name_element);
  $new_animal-&gt;appendChild($gender_element);
  $new_animal-&gt;appendChild($age_element);
  
  my $area_element = $root -&gt; findnodes("//area[\@id=$area]")-&gt;get_node(1);
  
  $area_element-&gt;appendChild($new_animal);
  </code></pre>
  
  <p>$area is the id of an area (usually 1 now that I'm testing)</p>
  
  <p>my purpose is to create a new animal and to add it to the proper area</p>
  
  <p>but I have the problem that the istruction</p>
  
  <pre><code>    my $area_element = $root -&gt; findnodes("//area[\@id=$area]")-&gt;get_node(1);
  </code></pre>
  
  <p>won't work, because $area_element is undef, because findnodes always returns an empty nodelist (checked printing the size()).</p>
  
  <p>I think that the problem is the xpath expression inside findnodes, but I can't understand what's wrong, I use the same expression with another library (XML::XPath) and it's working.</p>
  
  <p>What's wrong? </p>