fixing some of the libxml2 memory leaks