var xmlDoc = new XmlDocument(); xmlDoc.Load(fatalFile); var s = xmlDoc.SelectNodes("configuration/appSettings/add[@key='KeyName']")[0].Attributes["value"];