title: Mapping XML succeeds but object has empty values
body: <p>I'm using RKXMLReaderSerialization and trying to map an XML response from my server to an object. It succeeds, but the object from the mapping result just has empty values.</p>
  
  <p>Here's the text/xml response I'm trying to map from my server:</p>
  
  <pre><code>&lt;Provision version="1.0"&gt;
    &lt;FileInfoWrapper&gt;
      &lt;FileUrl&gt;SomeFile.zip&lt;/FileUrl&gt;
      &lt;FileName&gt;SomeFile.zip&lt;/FileName&gt;
      &lt;FileSha1&gt;oi7NK/rFLL6dXqcu7ahaNfKsGkE=&lt;/FileSha1&gt;
      &lt;FileSize&gt;52220448&lt;/FileSize&gt;
      &lt;Version&gt;13&lt;/Version&gt;
      &lt;Vital&gt;true&lt;/Vital&gt;
    &lt;/FileInfoWrapper&gt;
  &lt;/Provision&gt;
  </code></pre>
  
  <p>Here's my model object:</p>
  
  <pre><code>@interface FileInfoWrapper : NSObject
  
  @property NSString *fileUrl;
  @property NSString *fileName;
  @property NSString *fileSha1;
  @property long fileSize;
  @property NSString *version;
  @property BOOL vital;
  
  @end
  </code></pre>
  
  <p>I've added RKXMLReaderSerialization:</p>
  
  <pre><code>[RKMIMETypeSerialization registerClass:[RKXMLReaderSerialization class] forMIMEType:RKMIMETypeTextXML];
  [[self objectManager] setAcceptHeaderWithMIMEType:@"application/json,text/xml"];
  </code></pre>
  
  <p>I think I have the mapping and response descriptor setup correctly:</p>
  
  <pre><code>RKObjectMapping *fileInfoMapping = [RKObjectMapping mappingForClass:[FileInfoWrapper class]];
  [fileInfoMapping addAttributeMappingsFromDictionary:@{
   @"FileUrl":        @"fileUrl",
   @"FileName":       @"fileName",
   @"FileSha1":       @"fileSha1",
   @"FileSize":       @"fileSize",
   @"Version":        @"version",
   @"Vital":          @"vital"}];
  RKResponseDescriptor *fileInfoResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:fileInfoMapping
                                                                                                  method:RKRequestMethodGET
                                                                                             pathPattern:nil
                                                                                                 keyPath:@"Provision.FileInfoWrapper"
                                                                                             statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
  [[self objectManager] addResponseDescriptor:fileInfoResponseDescriptor];
  </code></pre>
  
  <p>But when I call:</p>
  
  <pre><code>[[self objectManager] getObjectsAtPath:@"static/download/Installer.info.xml"
                              parameters:nil
                                 success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
                                     NSLog(@"****Success!****");
                                     NSLog(@"mappingResult: %@", mappingResult);
                                     FileInfoWrapper *fileInfo = [mappingResult firstObject];
                                     NSLog(@"URL: %@", [fileInfo fileUrl]);
                                     NSLog(@"Name: %@", [fileInfo fileName]);
                                     NSLog(@"SHA1: %@", [fileInfo fileSha1]);
                                     NSLog(@"Size: %lx", [fileInfo fileSize]);
                                 }
                                 failure:^(RKObjectRequestOperation *operation, NSError *error) {
                                     NSLog(@"****Failure!****");
                                 }];
  </code></pre>
  
  <p>All the values are null:</p>
  
  <pre><code>I restkit.network:RKObjectRequestOperation.m:180 GET 'http://example.com/static/download/Installer.info.xml'
  I restkit.network:RKObjectRequestOperation.m:250 GET 'http://example.com/static/download/Installer.info.xml' (200 OK / 1 objects) [request=0.1080s mapping=0.0060s total=0.1226s]
  ****Success!****
  mappingResult: &lt;RKMappingResult: 0x10064b190, results={
      "Provision.FileInfoWrapper" = "&lt;FileInfoWrapper: 0x10065f780&gt;";
  }&gt;
  URL: (null)
  Name: (null)
  SHA1: (null)
  Size: 0
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>UPDATE:</strong> I turned on RestKit/ObjectMapping logging and got some additional info:</p>
  
  <pre><code>D restkit.object_mapping:RKMapperOperation.m:377 Executing mapping operation for representation: {
      Provision =     {
          FileInfoWrapper =         {
              FileName =             {
                  text = "SomeFile.zip";
              };
              FileSha1 =             {
                  text = "oi7NK/rFLL6dXqcu7ahaNfKsGkE=";
              };
              …
  }
   and targetObject: (null)
  T restkit.object_mapping:RKMapperOperation.m:320 Examining keyPath 'Provision.FileInfoWrapper' for mappable content...
  D restkit.object_mapping:RKMapperOperation.m:300 Found mappable data at keyPath 'Provision.FileInfoWrapper': {
      FileName =     {
          text = "SomeFile.zip";
      };
      FileSha1 =     {
          text = "oi7NK/rFLL6dXqcu7ahaNfKsGkE=";
      };
      …
  }
  D restkit.object_mapping:RKMapperOperation.m:231 Asked to map source object {
      FileName =     {
          text = "SomeFile.zip";
      };
      FileSha1 =     {
          text = "oi7NK/rFLL6dXqcu7ahaNfKsGkE=";
      };
      …
  } with mapping &lt;RKObjectMapping:0x10025e6b0 objectClass=FileInfoWrapper propertyMappings=(
      "&lt;RKAttributeMapping: 0x10025ebc0 FileSha1 =&gt; fileSha1&gt;",
      "&lt;RKAttributeMapping: 0x10025ed90 FileName =&gt; fileName&gt;"
      …
  )&gt;
  D restkit.object_mapping:RKMappingOperation.m:952 Starting mapping operation...
  T restkit.object_mapping:RKMappingOperation.m:953 Performing mapping operation: &lt;RKMappingOperation 0x10068f730&gt; for 'FileInfoWrapper' object. Mapping values from object {
      FileName =     {
          text = "SomeFile.zip";
      };
      FileSha1 =     {
          text = "oi7NK/rFLL6dXqcu7ahaNfKsGkE=";
      };
      …
  } to object &lt;FileInfoWrapper: 0x10068f290&gt; with object mapping (null)
  T restkit.object_mapping:RKMappingOperation.m:550 Mapping attribute value keyPath 'FileUrl' to 'fileUrl'
  T restkit.object_mapping:RKMappingOperation.m:431 Found transformable value at keyPath 'FileUrl'. Transforming from type '__NSDictionaryM' to 'NSString'
  D restkit.object_mapping:RKPropertyInspector.m:130 Cached property inspection for Class 'FileInfoWrapper': {
      fileName =     {
          isPrimitive = 0;
          keyValueCodingClass = NSString;
          name = fileName;
      };
      fileSha1 =     {
          isPrimitive = 0;
          keyValueCodingClass = NSString;
          name = fileSha1;
      };
      …
  }
  T restkit.object_mapping:RKMappingOperation.m:583 Skipped mapping of attribute value from keyPath 'FileUrl to keyPath 'fileUrl' -- value is unchanged ((null))
  T restkit.object_mapping:RKMappingOperation.m:550 Mapping attribute value keyPath 'FileSha1' to 'fileSha1'
  T restkit.object_mapping:RKMappingOperation.m:431 Found transformable value at keyPath 'FileSha1'. Transforming from type '__NSDictionaryM' to 'NSString'
  T restkit.object_mapping:RKMappingOperation.m:583 Skipped mapping of attribute value from keyPath 'FileSha1 to keyPath 'fileSha1' -- value is unchanged ((null))
  …
  </code></pre>