public IInternalConfigRecord GetUniqueConfigRecord(string configPath) {
BaseConfigurationRecord configRecord = (BaseConfigurationRecord) GetConfigRecord(configPath);
while (configRecord.IsEmpty) {
BaseConfigurationRecord parentConfigRecord = configRecord.Parent;
// If all config records are empty, return the immediate child of the
// root placeholder (e.g. machine.config)
if (parentConfigRecord.IsRootConfig) {
break;
}
configRecord = parentConfigRecord;
}
return configRecord;
}