I'm trying to get a return value from an ajax call but I keep getting "undefined"
function getUserName(targetName){
$.ajax({
type: "GET",
url: "http://servername/iMon/queryuser.pl?host="+targetName,
dataType: "XML",
success: function parseUserName(xml){
var userName = $(xml).find ('firstName').text()+' '+$(xml).find('lastName').text();
return userName;
});