I'm using Backbone.js to structure an application that usually communicates with web services via JSON.One web service will return JSON on success or XML in an error (clever, huh?). I need to parse this XML response to determine the error, but Backbone's JSON-centric thinking is causing me problems.I have a collection that includes a parse function. The parse function is always called when the service returns JSON, and in this case I simply return the response object. However, when the service returns XML my fetch call's error callback function is called, and passed an error object with \[code\]arguments[1]\[/code\] of \[code\]parseerror\[/code\]. Further digging shows there was an unexpected \[code\]<\[/code\] character.Why is my parse function not being called to parse the XML before a parseerror is thrown? Furthermore - why, in the successful JSON calls, is it passed a JavaScript object (indicating that the JSON string has already been parsed)? Isn't the parse function supposed to do the parsing?Relevant code below, any suggestions much appreciated.\[code\]var myCollection = Backbone.Collection.extend({initialize : function() { ...},fetch: function(options) { var options = {data: {...}, error: this.onFetchError}; Backbone.Collection.prototype.fetch.call(this, options);},onFetchError: function(arg1, arg2, arg3) { debugger},parse: function(response) { debugger if(typeof response === 'object') { return response; }}});return myCollection;\[/code\]