I am creating patch for web application with XML File changes in web.config.

Which is the most comfortable way to save xml changes if web.config is replaced by patch?
Simple applying old xml changes doesn't work for properties which were entered at custom dialog in initial setup, also storing some properties in registry(sql server login pass for example) is not good idea