i have found the solution .. thanks for your help sushil mate :)
protected void DeleteRoleRule(string location)
{
string path = Server.MapPath("~/Web.Config");
XmlDocument xDoc = new XmlDocument();
xDoc.Load(path);
XmlNodeList list = xDoc.DocumentElement.SelectNodes("location");
if (list.Count > 0)
{
foreach (XmlNode node in list)
{
XmlAttribute attribute = node.Attributes["path"];
if (attribute.Value == location)
{
node.ParentNode.RemoveChild(node);
XmlTextWriter xwriter = new XmlTextWriter(path, null);
xDoc.WriteTo(xwriter);
xwriter.Close();
}
}
}
}