Fix for #2. Essentially orders xml manipulations so that node removal actions are done first. I did not get seg fault when I ran 250 times so I am assuming it is fixed.
Coverage remained the same when pulling 8de2daaf18b39db44851c2005ead000c26ec1028 on libxmljs-mem-leak-workaround into bacc6a1c22785f2a3865966036c1bae9f1f3439c on master.
Fix for #2. Essentially orders xml manipulations so that node removal actions are done first. I did not get seg fault when I ran 250 times so I am assuming it is fixed.