i know its not XML but for me i always achieve that kind of functionality this way:
This is some JavaScript that will expect a controller processed answer.
$.post('<?php echo CController::createUrl('/someController/someAction'); ?>', {'someData': someData},
function(data){
var user = $('div.user',$(data)).html();
var id = $('div.id',$(user)).html();
var name = $('div.name',$(user)).html();
});
This is the Controller that processes the request and gives the answer:
public function actionSomeAction() {
$someData = $_POST['someData'];
// now doing something with that...
/**
* echo this now:
* <div>
* <div class="user">
* <div>
* <div class="id">12</div><div class="name">Peter</div>
* </div>
* </div>
* </div>
*/
}
its most important to enclose the data with a <div></div>
PS: not sure if this will work as it is, because i needed to remove a lot of redundant code for this example…