+int fulliterative(XMLTree* tree){
+ treeNode current = tree->Root();
+ treeNode next = NULLT;
+ int count = 1; //the root
+
+ do {
+
+
+ while ((next = tree->FirstChild(current)) != NULLT) {
+ current = next;
+ count++;
+ };
+
+ while ( (next = tree->NextSibling(current)) == NULLT){
+ current = tree->Parent(current);
+ if (current == NULLT) return count;
+ }
+ current = next;
+ count++;
+ } while (true);
+
+}
+
+extern "C" value caml_benchmark_iter(value tree){
+ return Val_int(fulliterative(XMLTREE(tree)));
+}
+