Statck allocation taken from pugixml