Ok, im trying to get the xml results from the variable (result) outside the function. When i place the highlighted code into the parseRoster function, it will work correctly, but when I move it outside the function it wont (says undefined). Any help would be appreciated

<script>
var result;
var roster;

$.ajax({
type: "GET",
url: "http://football33.myfantasyleague.com/2012/export?TYPE=players&L=62072",
dataType: "xml",
success : parseRoster
});

function parseRoster(xml) {
result = xml;
}

roster = $(result).find("player[id='0251']").attr("name");
alert(roster);

<script>