Q: JQuery XML Reading - Empty Variables I am using JQuery's .get function to retrieve an XML file.  When attempting to read the values of the file, all variables are empty.
Here is the function where I am retrieving and reading the XML file:
var get_locations = function(neLat, neLng, swLat, swLng, map, infoWindow)
        {
            $.get('Scripts/googlemap_ajax.php', {neLat: neLat, neLng: neLng, swLat: swLat, swLng: swLng}, 
            function(xml)
            {
                $(xml).find("marker").each(function()
                {
                    var name = $(this).find('name').text();
                    var tags = $(this).find('tags').text();
                    var coupon = $(this).find('coupon').text();
                    var icon = customIcons[coupon] || {};
                    var point = new google.maps.LatLng(
                                $(this).find('latitude').text(),
                                $(this).find('longitude').text());
        alert($(this).find('name').text());
                    var marker = new google.maps.Marker({
                        position: point,
                        map: map,
                        icon: icon.icon
                    }); 


                    var html = "HELLO THERE";

                    google.maps.event.addListener(marker, 'click', function() {
                            infoWindow.setContent(html);
                            infoWindow.open(map, marker);
                    });
                });
            }, "xml");
        };

When the code runs, I get an alert that the value of $(this).find('name').text() is empty.
Here is a corresponding XML file (verified through Firebug):
<markers>
<marker locationID="1" name="Chris' Food Place" tags="American, Sushi" latitude="34.113432" longitude="-117.169855" coupon="yes"></marker>
<marker locationID="2" name="Chris' Food Place 2" tags="American," latitude="34.1158092" longitude="-117.1704145" coupon="no"></marker>
</markers>

Here is the whole block of code, just in case anybody happens to spot something else that is causing the problem:
<style type="text/css" >

  html { height: 100% }

  body { height: 100%; margin: 0; padding: 0 }

</style>



<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>


<script type="text/javascript"> 

$(document).ready(function() 
{
    var alerted = false;

    function MYMAP() 
    {
        //internal
        var map = '';
        var center = '';
        var centerImage = '../Images/map_icon.png';
        var infoWindow = '';
        var last_ne_lat; //Check previous map corner

        var customIcons = {
              yes: {
                icon: 'http://labs.google.com/ridefinder/images/mm_20_blue.png',
                shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
              },
              no: {
                icon: 'http://labs.google.com/ridefinder/images/mm_20_red.png',
                shadow: 'http://labs.google.com/ridefinder/images/mm_20_shadow.png'
              }
        };

        var get_locations = function(neLat, neLng, swLat, swLng, map, infoWindow)
        {
            $.get('Scripts/googlemap_ajax.php', {neLat: neLat, neLng: neLng, swLat: swLat, swLng: swLng}, 
            function(xml)
            {
                $(xml).find("marker").each(function()
                {
                    var name = $(this).find('name').text();
                    var tags = $(this).find('tags').text();
                    var coupon = $(this).find('coupon').text();
                    var icon = customIcons[coupon] || {};
                    var point = new google.maps.LatLng(
                                $(this).find('latitude').text(),
                                $(this).find('longitude').text());
        alert($(this).find('name').text());
                    var marker = new google.maps.Marker({
                        position: point,
                        map: map,
                        icon: icon.icon
                    }); 


                    var html = "HELLO THERE";

                    google.maps.event.addListener(marker, 'click', function() {
                            infoWindow.setContent(html);
                            infoWindow.open(map, marker);
                    });
                });
            }, "xml");
        };


    //external:
    return {
            init: function(selector, latLng, zoom) 
            {
                var myOptions = {
                        zoom:zoom,
                        center: latLng,
                    streetViewControl: false,
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                }
                this.map = new google.maps.Map($(selector)[0], myOptions);
            },

            centerMarker: function(latlng) 
            {
                this.center = new google.maps.Marker({

                position: latlng,

                map: this.map,

                icon: centerImage,

                title: "You are here"

                });
            },

            addBoundChange: function() 
            {
                this.infoWindow = new google.maps.InfoWindow;
                test = this.map;
                test2 = this.infoWindow;
                // Add listener to map
                google.maps.event.addListener(this.map, 'bounds_changed', function() {
                    var zoom_level = this.getZoom();
                    if(zoom_level > 12)
                    {
                        var bounds = this.getBounds();
                        var ne = bounds.getNorthEast();
                        var neLat = bounds.getNorthEast().lat();
                        var neLng = bounds.getNorthEast().lng();
                                var sw = bounds.getSouthWest();
                        var swLat = bounds.getSouthWest().lat();
                        var swLng = bounds.getSouthWest().lng();
                        if( neLat != last_ne_lat)
                        {
                            last_ne_lat = neLat;    
                            get_locations(neLat, neLng, swLat, swLng, test, test2);

                        }
                    }
                    else //Alerts the user only once.
                    {
                        if(!alerted)    
                        { 
                            alerted=true;
                            alert("Please zoom in to continue displaying the location markers");
                        }
                    }
                });
            }

        };
    }
    var testMap = new MYMAP();
    var latlng = new google.maps.LatLng(<?php echo $lat; ?>,<?php echo $long; ?>);
    testMap.init('#map_canvas', latlng, 16);
    testMap.centerMarker(latlng);
    testMap.addBoundChange();

});
</script>


<body>
    <div id="locationSelect" style="width:100%"></div>

    <div id="map_canvas" style="width:70%; height:90%"></div>

</body>


A: Your target is an attribute, not a tag. Try $(this).attr("name") instead of $(this).find('name').text()

A: .find( selector ) is used for traversing the descendants of each element in the current set of matched elements
.attr( attributeName ) is used to get the value of an attribute for the first element in the set of matched elements
You are trying to access the attributes of the xml element. 
Use $(this).attr( attributeName ) to get the values.
