title: Find value of child node
body: <p>Ok, this is a pretty rudimentary question, but I'm new to Perl and I honestly can't seem to find the answer anywhere, even though I'm sure it will be ridiculously simple.  </p>
  
  <p>Let's say I have the following XML schema:</p>
  
  <pre><code>&lt;root&gt;
      &lt;parentNode status="Good"&gt;
          &lt;A&gt;
              &lt;B&gt;
                  &lt;value&gt;&lt;![CDATA[This is my value]]&lt;/value&gt;
              &lt;/B&gt;
          &lt;/A&gt;
      &lt;/parentNode&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Assume there are going to be multiple parentNodes with varying statuses.</p>
  
  <p>I'm trying to write a script that will give me the content of each of the value nodes of the parentNodes where status isn't "Good"</p>
  
  <p>Using the following code I've been able to successfully get the correct parentNodes:</p>
  
  <pre><code>my $parser = XML::LibXML-&gt;new();
  my $tree = $parser-&gt;parse_file($xml_file);
  my $root = $tree-&gt;getDocumentElement;
  my @records = $root-&gt;findnodes("//parentNode");
  foreach my $node (@records) {
      my $resultAtt = $node-&gt;getAttribute('status');
      next if $resultAtt ne "Good";
  </code></pre>
  
  <p>But when I try: </p>
  
  <pre><code>my $val = $node-&gt;findvalue("value");
  </code></pre>
  
  <p>I get nothing.  </p>
  
  <p>Additionally, I'm really just interested in the "This is my value" part.  When you read the value, does the CDATA affect it at all?</p>