The below program will do the work
using System;
using System.Xml.Linq;
namespace Test
{
class Program
{
static void Main(string[] args)
{
XDocument
.Load(@".\Web.config")
.Descendants("appSettings")
.Descendants("add")
.ToList()
.Foreach(element=>Console.WriteLine($"SET {element.FirstAttribute.Value}=\"{element.LastAttribute.Value}\""));
Console.ReadKey();
}
}
}