children() as $child) { foreach ($child->children() as $data) { if($data->name) { $node = $data->name; $cont = $data->data->contents; array_push($rsp, "$node: $cont"); } else if(strlen("$data") > 2) { array_push($rsp, "$data"); } } } $rtn = array("rsp" => $rsp, "msg" => ''); echo json_encode($rtn); } ?>