Avoid nested function in order to access a local variable

I want to load an XML file and access one node value.
I decided to store it in a variable(var addedNumber).

The problem is I want to access this variable in a new function (loadURL)“outside” of the scope.
Is there a clearer way to do this instead of using nested function?

var XMLLoader:URLLoader;
var XMLPath:URLRequest;
var XMLDoc:XMLDocument = new XMLDocument();
XMLDoc.ignoreWhite=true;
var XMLData:XML;
var addedNumber:Object;
XMLPath=new URLRequest("test.xml");
XMLLoader=new URLLoader(XMLPath); 
XMLLoader.addEventListener("complete", extractXMLFileData);  
function extractXMLFileData(event:Event):void 
{     var XMLData = XML(event.target.data);  
var addedNumber = XMLData.np.text();
trace("wwww.ssss.com?"+ addedNumber );// traces wwww.ssss.com?2 Correct
loadURL();
}

function loadURL():void{	
	trace("wwww.ssss.com?"+ addedNumber );//traces wwww.ssss.com?null ---Here is the problem
	
	}