Better way of checking for XML responses

Instead of checking for the first character being '<', we should check the content type of the response, if it matches "application/xml".

Reason for this is if you get an HTML response, it will incorrectly try and parse it as XML. (HTML response being an Apache/Nginx fail page for example)