XML + PHP Sockets

Let’s say I wanted to create a 3d chat room type of application. I would need to keep passing the user, x & y coords and the message right? I would do this by xmlSocket.send("<User>blah</user><X>100</x> etc.")? and then use the php script to parse the information and send it to other users? Am I right, or is there a simpler method to do this?