Randomly receive a value from XML

I have the following XML

<countries>
                 <country>
                       <name>foo</name>
                       <phrase1>foo2</phrase1>
                       <phrase2>foo3 </phrase2>
                       <phrase3>foo4</phrase3>
                </country>
          </countries>

And i have a system that generates 40 stars, and each of those stars i want to have a information on them ( 1 have 40 countries in my xml, and 40 generated stars in the flash).

I have the following to randomly get a country name:


var countries:Array = new Array();

for (var est:int = 0;est < 40; est++) {
countries = [];

    var ps:int = (Math.floor(Math.random()*countries.length));
    countries.push(myXML.country.name[ps]);



But i can’t get a random number from there. Any ideas?