code: public function replacePreferences($preferences)
  	{
  		$token = $this->oauth->getToken();
  
  		// Set parameters.
  		$parameters = array(
  			'oauth_token' => $token['key'],
  		);
  
  		// Set the API base
  		$base = 'user/preferences';
  
  		// Build the request path.
  		$path = $this->getOption('api.url') . $base;
  
  		// Create a list of preferences
  		$preferenceList = '';
  
  		if (!empty($preferences))
  		{
  			foreach ($preferences as $key => $value)
  			{
  				$preferenceList .= '<preference k="' . $key . '" v="' . $value . '"/>';
  			}
  		}
  
  		$xml = '<?xml version="1.0" encoding="UTF-8"?>
  			<osm version="0.6" generator="JoomlaOpenStreetMap">
  				<preferences>'
  				. $preferenceList .
  				'</preferences>
  			</osm>';
  
  		$header['Content-Type'] = 'text/xml';
  
  		// Send the request.
  		$response = $this->oauth->oauthRequest($path, 'PUT', $parameters, $xml, $header);
  
  		return $response->body;
  	}
docs: Method to replace user preferences
  
  @param   array  $preferences  Array of new preferences
  
  @return  array  The XML response
  
  @since   1.0