refactoring, XMLed the communication

Applied some good DRY
Some cleanup
Changed the responses from byte sequences to XML