Yes, you don't need pointer. PrintHead() is a function like the constructor. You need the pointer if you want to call the function from outside the class
The constructor has a special trait. You can write it like so:
1 2 3 4
Node(int id) : ID(id)
{
PrintHead(false);
}
Node(int id) : ID(id) is called initializer list. It's the way to call the constructors of the member variables (and may avoid unnecessary copy)
In this way (putting start and end tags in constructor and destructor) I don't have control over where to put them. Isn't it better to create to public function and do tag insertion in it? I mean I make PrintHead function public and don't use them in constructor/destructor.
For what you show `0' is the parent of `1' and `2', that could be easily represented with a tree.
You need to finish the inner nodes before the outer, that suggest a pre-order traversal.
I haven't used C++ to do XML, but I did have fun playing with outputting HTML pages with it out of pure boredom. Honestly, it sounds like it is being made more complex than it need be to me though.