maybe you should try this
function user_get()
{
if(!$this->get('id'))
{
$this->response(NULL, 400);
}
function users($id){
$query = $this->db->get('student');
$this->db->where('EID', $id);
$config = array (
'root' => 'users',
'element' => 'item',
'newline' => "\n",
'tab' => "\t"
);
$this->load->dbutil();
echo '<?xml version="1.0" encoding="utf-8" ?> ';
print $this->dbutil->xml_from_result($query, $config);
}
$id = @$users[$this->get('id')];
if($user)
{
$this->response($user, 200); // 200 being the HTTP response code
}
else
{
$this->response(array('error' => 'User could not be found'), 404);
}
}