When selecting one, you can use select event and:
function onMenuTreeClick(oControlEvent){
var node = oControlEvent.getParameter("node");
var selectedId = node.sId;
For disabling select functionality for some nodes, you can use selectable property of TreeNode when creating the nodes.
Regards,
Kimmo