     // 
     //--------------------------------------------------------------------------
 
-	//----------------------------------
-	//  xml
-	//----------------------------------
+    //----------------------------------
+    //  xml
+    //----------------------------------
 
     /**
      *  The XML configuration; this value must contain the relevant portions of

     */
     mx_internal static function updateServerConfigData(serverConfig:ConfigMap, endpoint:String = null):void
     {      	        
		if (serverConfig != null) 
		{	
		    if (endpoint != null)
		    {
    		    // Add the endpoint uri to the list of uris whose configuration 
    		    // has been fetched.
    		    if (_configFetchedChannels == null)
    		        _configFetchedChannels = {};
    		        
    		    _configFetchedChannels[endpoint] = true;
		    }
		    
			var newServices:XML = <services></services>; 																						
			convertToXML(serverConfig, newServices);
	        
	        // Update default-channels of the application     
            xml["default-channels"] = newServices["default-channels"];	             
            
            // Update the services
			for each (var newService:XML in newServices..service)
			{    
				var oldServices:XMLList = xml.service.(@id == newService.@id);
				if (oldServices.length() != 0)
				{					
					// Assuming only one service exists with the id
					var oldService:XML = oldServices[0];
														
					// Update destinations
					for each (var newDestination:XML in newService..destination)
					{
						var oldDestinations:XMLList = oldService.destination.(@id == newDestination.@id);
						if (oldDestinations.length() != 0)
						{
							// Assuming only one destination exists with the id
							delete oldDestinations[0];							
						}
						oldService.appendChild(newDestination);
					}
				}
				else
				{
					xml.appendChild(newService);			
				}
			}
			
			// Update the channels
			var newChannels:XMLList = newServices.channels;
            if (newChannels.length() > 0)
            {                
       		    var oldChannels:XML = xml.channels[0];          
	    		if (oldChannels == null || oldChannels.length() == 0)	    		
    			{
			        xml.appendChild(newChannels);
	    		}
	    		// Commenting this section out as there is no real use case
	    		// for updating channel definitions. 
	    		/*
		    	else
			    {
			        for each (var newChannel:XML in newChannels.channel)
			        {
			            var oldChannel:XMLList = oldChannels.channel.(@id == newChannel.@id);
			            if (oldChannel.length() > 0)
	                    {
	                        // Assuming only one channel exists with the same id.
	                        delete oldChannel[0];	                    	                    
	                    }
	                    oldChannels.appendChild(newChannel);        
			        }
			    }
			    */
            }			   
		}
     }
   
    //--------------------------------------------------------------------------

    // 
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  The server configuration data.
     */
    public static var serverConfigData:XML;
    
    /**
     *  @private
     *  Caches shared ChannelSets, keyed by strings having the format:
