XML Flash ActionScript

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var foodgroup:XML = 
                      
                        Apple
                        Orange
                        Pear
                        Watermelon
                        3
                      

                      
                        Tomato
                        Potato
                        Broccoli
                        2
                      

                    
;
        var fruitList:XMLList = foodgroup.fruits.fruit;
        
        var theApple:XML = foodgroup.fruits.fruit[0];
        
        var vegetableList:XMLList = foodgroup..vegetable;
        
        var servings:XMLList = foodgroup.*.servings;
        
        var colorValues:XMLList = foodgroup.fruits.fruit.@color;
        
        
        trace( foodgroup..fruit.( @color == "red" ) );
        
        trace( foodgroup..*.( hasOwnProperty( "@color" ) && @color == "red" )  );
        
    }
  }
}