modified code to handle xml data from the client