title: How do I display XML descendants of a node with a specific attribute in AS3?
body: <p>I've been trying to figure out how to display the descendants (in this case exchangeRate and PlacesOfInterest) of a parent node with a specific attribute.</p>
  
  <p>To set the scene - the user clicks on a button which sets a string variable to a destination eg. japan or australia.</p>
  
  <p>The code then runs through a set of nodes in the XML and any that have a matching attribute is traced - simple enough</p>
  
  <p>What I can't figure out is how to then display only the child nodes of the node with that attribute.</p>
  
  <p>I'm sure there has to be a way of doing it and I'll probably be banging my head against the desk when I find it, but any help would be greatly appreciated!</p>
  
  <pre><code>public function ParseDestinations(destinationInput:XML):void 
      {
          var destAttributes:XMLList = destinationInput.adventure.destination.attributes();
  
          for each (var destLocation:XML in destAttributes) 
          {               
              if (destLocation == destName){
                  trace(destLocation);
                  trace(destinationInput.adventure.destination.exchangeRate.text());
              }
          }
      }
  
  
  
  &lt;destinations&gt;
      &lt;adventure&gt;
          &lt;destination location="japan"&gt;
              &lt;exchangeRate&gt;400&lt;/exchangeRate&gt;
              &lt;placesOfInterest&gt;Samurai History&lt;/placesOfInterest&gt;
          &lt;/destination&gt;   
          &lt;destination location="australia"&gt;
              &lt;exchangeRate&gt;140&lt;/exchangeRate&gt;
              &lt;placesOfInterest&gt;Surf and BBQ&lt;/placesOfInterest&gt;
          &lt;/destination&gt;
      &lt;/adventure&gt;
  &lt;/destinations&gt;
  </code></pre>