it is a xml file, you can modify it through classes in System.Xml, but be warned, by modifying web.config, the web app will be restarted and your state information will be lost<%@ Import Namespace="System.Xml" %>
<script language="C#" runat="server">
void Page_Load(Object o, EventArgs e)
{
   string sFile = Server.MapPath("web.config");
   XmlDocument xmldoc = new XmlDocument();
   xmldoc.Load(sFile);
   XmlNode node = xmldoc.SelectSingleNode("//add");
   if (node != null)
node.Attributes["value"].Value = "123";
   xmldoc.Save(sFile);
}
</script>