Restart play mode in editor via C++

I press play in the editor and then a XML files is being red to update the positions of objects in the scene. But at the end of the XML file it should load a new XML file and recreate a new environment in the scene. The easiest solution right now would be to restart the game, is there a way to do that in C++ code, could I just call the BeginPlay() method or is there something else that needs to be done?

We did some test with calling BeginPlay() in order to restart the play mode, but it results in memory access violation?