What you mean is opening, reading and writing to a socket. Read the documentation on this subject for more information. The xml is just an accessory to your actual communications, which will happen, one way or another, via sockets.
EDIT: And thus you will not need any library since sockets are part of php by default.