Just to get You started: You'll need to take a look
here. There You have highlighted list of all available sort methods in XBMC. Now You have to get integer "id" of sort method You want: (SORT_METHOD_NONE=0, SORT_METHOD_LABEL=1, SORT_METHOD_LABEL_IGNORE_THE=2, ..., just add +1 for every next one). And use that id with Container.SetSortMethod(id).
Example:
Container.SetSortMethod(24) will set sorting to titles (in video section) (SORT_METHOD_VIDEO_SORT_TITLE)
Container.SetSortMethod(18) will set sorting to raiting (SORT_METHOD_VIDEO_RATING)
Notes:
Not every sort method is available in each view, so You'll have to experiment a little.
There are some sorts with _IGNORE_THE appended - xbmc automaticly switch to them if user set
Ignore articles when sorting (e.g. "the") in settings -> appearance -> file lists.
-edit
damn, Hitcher was first ;P