Use this to pull all selected categories in a widget category select. After you use this code to grab them you can make it part your dotcontent.pull query like this:
+(categories:$catlist)
#foreach($inode in $categoriesToDisplay)
#if($velocityCount == 1)
#set($catlist = $categories.getCategoryByInode($inode).getCategoryVelocityVarName())
#else
#set($catlist = "$catlist $categories.getCategoryByInode($inode).getCategoryVelocityVarName()")
#end
#end