1) You can't write to the app bundle. Period. Write to somewhere else (for example, to the Documents directory).
2) What is this code supposed to do? It makes absolutely no sense.
NSString *highscorePath = [[NSString alloc]init];
NSArray * paths = [[NSBundle mainBundle] pathsForResourcesOfType: @".xml" inDirectory:@""];
for ( NSString * path in paths )
{
highscorePath = [path substringToIndex:([path length])];
}