Order of execution incorrect

I have an external as3 file for my timeline. I’m trying to download data from an xml file when a button is clicked. First, I have an xml loader. When it’s finished loading, I assign the data to an xml variable. The trouble is, when I start this code from the onclick event, the code executes the xml loader, then the trace from onclick, then the assignment of the xml variable! So my data is always null! When I load the data from the constructor class, all is well. How can I make the execution take place in the proper order?

SimpleButtonDemo.as:

package {
import flash.display.;
import flash.events.MouseEvent;
import flash.net.
;
import flash.events.*;
import flash.errors.IOError;
import gs.TweenLite;

public class SimpleButtonDemo extends Sprite {
    private var _myLine:Sprite = new Sprite();
    private var _ldrGov:URLLoader; //loader of the xml file
    private var _myXML:XML; //the xml data
    private var _xmlFile:String;//file path of xml file
    
        public function SimpleButtonDemo() {
        
            
        var govButton:RectangleButton = new RectangleButton( "GOVERNOR", 100, 26 );
        govButton.x = 5;
        govButton.y = 5;
        
                   
        addChild( govButton );
        
        
        govButton.addEventListener( MouseEvent.CLICK, handleGovClick );
        
        
        
        
    }
    
    //load the xml data file 
    private function getXML(xmlFile:String) {
        _ldrGov = new URLLoader();
        _ldrGov.addEventListener(Event.COMPLETE, onLoadXML);
        _ldrGov.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
        _ldrGov.load(new URLRequest(xmlFile + "?" + Math.round(Math.random() * 999999)));
        trace("1st function");
    }
    //when the xml data is loaded for the first time, 
    //get the municipal properties, methods, data
    private function onLoadXML(ev:Event) {
        try {
            _myXML = new XML(ev.target.data);
            trace("2nd function");
            
        //if the data file doesn't load, send the user a message
        } catch (e:TypeError) {
            trace("Could not parse the XML");
            trace(e.message);
        }//end catch
    }
    
    private function onIOError(evt:IOErrorEvent):void {
        trace("An error occurred when attempting to load the XML.

"
+ evt.text);
}

    private function handleGovClick (event:MouseEvent):void {
        _xmlFile = "http://mypath/myfile.xml";
        getXML(_xmlFile);
        trace( _myXML);
       
    }
}

}