That's basicly it man:

How can I check if a node has children or not ?