I've been experimenting with Socket communication between Flash and Java. One advantage of Socket over XMLSocket is bandwidth, because you can write binary data. So for example, you can send a single entity's position as:
writeShort(entity.id); writeFloat(entity.x); writeFloat(entity.y);
Which is just 10 bytes.
Java supports similar primitive read/write functions with either DataStreams or ByteBuffers.
Actually, the server side of things is more complicated than the Flash side, because you have to choose between the old io Java sockets and the new io methods. The new io methods have much better performance, but are more complicated and apparently filled with gotchas.