public function import_from_xml($xml, $fromform, qformat_xml $format, $extra=null) {
        // Return if data type is not our own one.
        if (!isset($xml['@']['type']) || $xml['@']['type'] != $this->name()) {
            return false;
        }

        // Import the common question headers and set the corresponding field.
        $fromform = $format->import_headers($xml);
        $fromform->qtype = $this->name();
        $format->import_combined_feedback($fromform, $xml, true);
        $format->import_hints($fromform, $xml, true);

        $extras = $this->extra_question_fields();
        array_shift($extras);
        foreach ($extras as $extra) {
            $fromform->$extra = $format->getpath($xml, array('#', $extra, 0, '#'), '', true);
        }

        return $fromform;
    }