I got a lot of write, read and free errors. I don't know where is mistake. If someone could help me out with this I'd be grateful. Here is log from valgrind:
http://pastebin.com/TR4Ts73Y
void deleteElement(element* node) {
element* child;
if (node == NULL)
return;
free(node->name);
if (node->text != NULL)
free(node->text);
child = node->firstChild;
while(child != NULL)
{
deleteElement(child);
child = child->nextSibling;
}
free(node);
}
If you need more functions feel free to ask for.