What was the result of testing it? Not working?
The `while()` is there to deal with xml docs that have many `dialog` nodes. The `do { ... } while ()` is to find the next node with `dialog` name. These are to be compliant with xml specs, as there can be other nodes with different names. So just doing `node=node->next` doesn't ensure it will be the next `dialog` node, but the next node in the xml document.