This looks wrong:
[doc release]
Why are you freeing a property-driven object?
In your @synthesize statements, change them:
@synthesize doc = doc_;
@synthesize xmlBody = xmlBody_;
Then commit all errors received to go through the property, freeing the properties ONLY in dealloc.
Edit:
You say that it throws an XML release. This code is incorrect:
NSString *theXML = [[NSString alloc] initWithBytes:[xmlData bytes] length:[xmlData length] encoding:NSUTF8StringEncoding];
theXML =[theXML stringByReplacingOccurrencesOfString:@"inferenceresponse" withString:@"inferencerequest"];
[theXML release];
, "stringByReplacing..." , , , , . , , autorelease. :
NSString *theXML = [[[NSString alloc] initWithBytes:[xmlData bytes] length:[xmlData length] encoding:NSUTF8StringEncoding] autorelease];
theXML =[theXML stringByReplacingOccurrencesOfString:@"inferenceresponse" withString:@"inferencerequest"];
[releaseXML] - .
, ARC, ... .