function listAllclientsformap() { // Where the ruby outputs the headings $requestAddress = "http://pathtomyrubyscaffold/clients.xml"; // Reads contents $xml_str = file_get_contents($requestAddress,0); // Parses XML $xml = new SimplexmlElement($xml_str); // Loops XML foreach($xml->client as $client) { echo "locations.push(Array('$client->lat','$client->lng','$client->firmname','$client->city','$client->id'));\n"; } }