I want to do this because I have to configure 3 arduinos and I think its faster to add a few lines of code to the setup than configuring each one individually with XCTU right?
You have to configure other things, too, right? Like MY, DL, etc.
You need to read the existing configuration, and then rewrite it, right?
You need to perform error checking on the parameter and value, right?
I think that using X-CTU will be easier. But, that might be just me.
If i'm not wrong there should also be a delay of 1 sec before and after the +++ correct¿?
If the XBee doesn't receive a command every second or less while in command mode it exits command mode. So, a one second delay after entering command mode hardly seems like a good idea. The delay before entering command mode is plain useless. It simply wastes a second.