Why don't you use :
var sessionStatString = (SessionStateSection)WebConfigurationManager.GetSection("system.web/sessionState");
For SessionStateSection : import namespace, using System.Web.Configuration;
UPDATE:
Regex.Replace(Content, "</?(sessionState|SESSIONSTATE).*?>", string.Empty)
Note: I strongly recommend not to update configuration file run time