protected function getGenerator() { if (!isset($this->generator)) { $this->generator = $this->initializeGenerator(); $this->generator->startDocument('Version'); $this->generator->startHashElement('Field'); } return $this->generator; }