get xml data from jquery
<p>Is this even doable? I have an xml file formatted as so;</p>

<pre><code>&lt;CoordinateData&gt;
 &lt;Country name="Australia"&gt;  
  &lt;Marker&gt;  
      &lt;LocationName&gt;Port of Coff&amp;#39;s Harbour&lt;/LocationName&gt;
      &lt;Longitude&gt;153.0900&lt;/Longitude&gt;
      &lt;Latitude&gt;-30.1800&lt;/Latitude&gt;
      &lt;/Marker&gt;
  &lt;Marker&gt;      
      &lt;LocationName&gt;Port of Sydney&lt;/LocationName&gt;
      &lt;Longitude&gt;151.1750&lt;/Longitude&gt;
      &lt;Latitude&gt;-33.4500&lt;/Latitude&gt;     
  &lt;/Marker&gt;
  &lt;Marker&gt;      
      &lt;LocationName&gt;Port of Melbourne&lt;/LocationName&gt;
      &lt;Longitude&gt;144.9450&lt;/Longitude&gt;
      &lt;Latitude&gt;-37.8370&lt;/Latitude&gt;     
  &lt;/Marker&gt;
  &lt;/Country&gt;
  &lt;Country name="USA"&gt;
  &lt;Marker&gt;
    &lt;LocationName&gt;Natchez_MS&lt;/LocationName&gt;
    &lt;Longitude&gt;91.4030&lt;/Longitude&gt;
    &lt;Latitude&gt;31.5603&lt;/Latitude&gt;
  &lt;/Marker&gt;
  &lt;Marker&gt;
    &lt;LocationName&gt;Paducah_KY&lt;/LocationName&gt;
    &lt;Longitude&gt;88.6010&lt;/Longitude&gt;
    &lt;Latitude&gt;37.0833&lt;/Latitude&gt;
  &lt;/Marker&gt;   
&lt;/Country&gt;
</code></pre>

<p>The file is shortened for brevity but you get the picture. I want to retrieve the data for a specific country based on a dropdown selection. I want to retrieve all the lat and long data for that countries markers. To determine the charts center i want to put all the latitudes in an array and average them for the chart center latitude and do the same for longitude. I can retrieve the data via .get but im not familiar with how to parse and average the retrieved data in jquery. The goal is to have one avg latitude and one avg longitude to use as the maps center coordinates.</p>

<p>I can't seem to even GET the xml data. The file is in the folder OtherDataFiles which is a folder in the root of my website. The following code doesn't even show the alert.</p>

<pre><code> $(document).ready(function () {
        var id;
        $.ajax({
            type: "GET",
            url: "OtherDataFiles/CoordinateData.xml",
            dataType: "xml",
            success: function(xml) {
                $(xml).find('Marker').each(function() {
                    if (id === "") {
                        id = $(this).attr('name');
                    } else {
                        id = id + "," + $(this).attr('name');
                    }


                });
            }
        });
        alert(id);
    });
</code></pre>
