RESTful Web Services return value

Your browser is complaining because the result isn’t valid xml, because there is no root element.
The xml will be something like 1Marco if you check the page source.

To have a valid xml, wrap your result in a single node, like this:

var _obj = new Object()
_obj.result = new Object()
_obj.result.id = 1
_obj.result.myName = "Marco"
return _obj

Another tip is to use a more declaritive approach using this literal notation as example:

var id = 1;
var myName = 'Marco';

var result = {
	result: {
		id: id, myName: myName
	}
}
	
return result;