How to save a NSDictionary ?

dataRepresentationOfType and loadDataRepresentation which are taing NSData arguments ?
I want to use the plist format for my application's document: how to implement

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
if ([aType isEqualToString:
my_document_type_name]) {
NSString *error;

return [NSPropertyListSerialization dataFromPropertyList:
myDictionaryVar format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];
}
return nil;
}

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
if ([aType isEqualToString:
my_document_type_name]) {
NSString *string = [[[NSString allocWithZone:[self zone]] initWithData:data encoding:NSUTF8StringEncoding] autorelease] ;

myDictionaryVar = [[[string propertyList] mutableCopy] retain] ;

return YES ;
}
return NO;
}

Of course, a little bit more error checking will not hurt in a real application… ;)
A simple solution could be: