private void saveCompletedForm(Element iqCommand, SessionData session) {
        Element formElement = iqCommand.element(QName.get("x", "jabber:x:data"));
        if (formElement != null) {
            // Generate a Map with the variable names and variables values
            Map<String, List<String>> data = new HashMap<>();
            DataForm dataForm = new DataForm(formElement);
            for (FormField field : dataForm.getFields()) {
                data.put(field.getVariable(), field.getValues());
            }
            // Store the variables and their values in the session data
            session.addStageForm(data);
        }
    }
Stores in the SessionData the fields and their values as specified in the completed
data form by the user.

@param iqCommand the command element containing the data form element.
@param session the SessionData for this command execution.
xmppserver/src/main/java/org/jivesoftware/openfire/commands/AdHocCommandManager.java