That's okay though right? That's what you're trying to capture for the errors? I assume that you can get it to work properly, but the problem you're having is capturing the errors?
You'll need to post the XMLData class. I don't know how it traverses this since its not actually XML, but you need to get into the messages/message/code and content blocks. You may need to check with the authorize.net api for what exactly it returns on the call; a schema would be handy assuming its xml.
header('HTTP/1.1 420 Enhance Your Calm');