static void print_element_names(xmlNode * a_node) { xmlNode *cur_node = NULL; xmlNode *test = NULL; cur_node = a_node; while(cur_node != NULL) { printf("%s\n", cur_node->name); if(cur_node->children != NULL) { print_element_names(cur_node->children); } cur_node = cur_node->next; } }