Even though there is a nice XBMC add-on to configure your WIFI settings, sometimes, you may still want to setup the WIFI connection for many reasons or just for fur.
OpenELEC use connman for managing connection to the various available network.
Setuping connman to connect to your protected WIFI network is an easy requiring you only to create a config file and enter some commands in a shell.