I have used something simple like this for printing hierarchy. It might not be the most optimal solution to your problem, since GetChildren seems to have one version where you can ask children recursively.
void MainGame::printNodeHierarchy( Node* node ) {
LOGINFO( "Main:" + node->GetName() );
const auto& children = node->GetChildren();
for( unsigned int i = 0; i < children.Size(); ++i ) {
Node* node = children[i];
LOGINFO( "Child:" + node->GetName() );
LOGINFO( "Position:" + String( node->GetPosition() ) );
printNodeHierarchy( node);
}
}
And then calling it by passing a scene to it since scenes are inherited by nodes, although it is using c++11.