Try this instead:
string path = Environment.ExpandEnvironmentVariables("%NAME_OF_THE_PATH%/Default_TestRunConfiguration.xml");
XDocument configuration = XDocument.Load(path);
This will work with multiple environment variables, and avoids you having to handle them specially. It means you can use the same sort of string as you would in a batch file.