When a tree has a selected node and you collapse the tree either with the Collapse button or by manually closing the leafs, the selection reverts to the parent node.
When you expand all the selected node is not updated.
This makes the use of the tree for selection purposes confusing.
In fact when you collapse the selection should be cleared otherwise the end user would think that the selected node is the parent and not a child.
Selecting the parent may make sense to indicate that a selection is available inside this leaf but then a different color should be used to diferentiate a selection from a indication that a selection is available inside this leaf.
You can see this problem here:
http://apex.oracle.com/pls/apex/f?p=57708