There is a comment in Tree.js which says "Expand nodes corresponding to values that were previously expanded". But if it doesn't work out of the box for you, it might be a bug, or it might not be designed to take place in certain kind of updates, who knows. There doesn't seem to be a specific way to keep nodes expanded.
I fear that xxforms:tree
hasn't been maintained since 3.9 at all. So using a newer version wouldn't help.
For reference here is the documentation.