function action() { if ($this->_context[2] == 'saved') { $this->_context[2] = NULL; } $fields = new XMLElement('fields'); General::array_to_xml($fields, (array) $_POST['fields']); $this->_XML->appendChild($fields); parent::action(); }