private static string InjectActiveConfigId(string xpath) { int index = ConfigPathPrefix.Length; return xpath.Insert(xpath.IndexOf("/", index), String.Format("[@id='{0}']", GetActiveConfigId())); }