Lets suppose you have a data source in XML like:

<Settings>
    <ElementCollection>    
        <add key="SomeKey" value="SomeValue">
        <add key="SomeKey" value="SomeValue">
    </ElementCollection>
</Settings>

Now you want to edit the key and values with in the xml element collection.

<asp:XmlDataSource ID="configXmlDataSource" XPath="//add" 
    runat="server" DataFile="~/settings.config"/> 

Use the following code in the code-behind

// In this code we are getting the Data Item values 
// of the Rad Editor. On UpdateCommand Event we are getting 
// the values of data row in an instance of hash.   
GridDataItem dataItem = (GridDataItem)e.Item;    
Hashtable ht = new Hashtable();    
dataItem.ExtractValues(ht);   

// Get the node values as per the selected key name:    
XmlNode AppNode = XmlDataSource1.GetXmlDocument().SelectSingleNode
    ( String.Format("//add[@key='{0}']", key));

// Now assign the new value of the Value attribute of the 
// selected node:  
AppNode.Attributes["value"].Value = ht["value"];  

//Finally we need to update the xml source file:  
configXmlDataSource.Save();