added support for handling XML responses