adding a method toggleNode

I needed a possibility to toggle a node without knowing the current state of the node (expanded or collapsed).