static SearchParameters parseSearchParameters( final Element formElement ) throws ParseException, IllegalArgumentException
    {
        Log.debug( "Parsing search parameters from request." );

        final SearchParameters result = new SearchParameters();

        final DataForm df = new DataForm( formElement );
        final FormField qFF = df.getField( VAR_Q );
        if ( qFF != null )
        {
            result.setQ( qFF.getFirstValue() );
        }

        final FormField sinnameFF = df.getField( VAR_SINNAME );
        if ( sinnameFF != null )
        {
            final String b = sinnameFF.getFirstValue();
            if ( b != null )
            {
                result.setSinname( DataForm.parseBoolean( b ) );
            }
        }

        final FormField sinddescriptionff = df.getField( VAR_SINDESCRIPTION );
        if ( sinddescriptionff != null )
        {
            final String b = sinddescriptionff.getFirstValue();
            if ( b != null )
            {
                result.setSindescription( DataForm.parseBoolean( b ) );
            }
        }

        final FormField sinaddrFF = df.getField( VAR_SINDADDR );
        if ( sinaddrFF != null )
        {
            final String b = sinaddrFF.getFirstValue();
            if ( b != null )
            {
                result.setSinaddr( DataForm.parseBoolean( b ) );
            }
        }

        final FormField minUsersFF = df.getField( VAR_MIN_USERS );
        if ( minUsersFF != null )
        {
            final String i = minUsersFF.getFirstValue();
            if ( i != null )
            {
                result.setMinUsers( Integer.parseInt( i ) );
            }
        }

        final FormField keyFF = df.getField( VAR_KEY );
        if ( keyFF != null )
        {
            final String k = keyFF.getFirstValue();
            if ( k != null )
            {
                result.setKey( Key.valueOf( k ) );
            }
        }

        Log.debug( "Parsed: " + result );
        return result;
    }
Constructs an answer on a IQ stanza that contains a search request. The
answer will be an IQ stanza of type 'result' or 'error'.

@param iq The IQ stanza that is the search request.
@return An answer to the provided request.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/IQMuclumbusSearchHandler.java