I've added some functionality to the "makeMySelBox" function in the XoopsTree class in /class/XoopsTree.php.
Firstly, it adds the option to show a multiple select box, rather than a drop down box. Secondly, it will now also automatically handle arrays passed to it, and will select the displayed options accordingly.
I've not tested it properly yet, but hopefully you'll be able to use the code in it.
(P.S. the file/class/main function names were changed to amtree so I could test it separately from XoopsTree)
Modified XoopsTree.php file