free memory after parsing XML