fixing some ownership issues for XMLElement in python wrapper