what i typically do if i need to get worksets from elements is to first make a dictionary of the workset ids and either the workset names or the workset objects. since the workset IDs come as ints, you can just do this with index lookup, but the dict packages it nicely.
so when you get the workset id from your element.getparametervalue node, you just look it up against the dict.