public function getFunctionariesFromAssociation($aid, $apiServiceFilterContext = null)
    {
        $apiServiceFilterContext = $this->checkApiServiceFilterContext($apiServiceFilterContext, $aid);

        $url = $this->getBaseApiUrl() . '/associations/' . $aid . '/functionaries';

        $params = null;

        $xml = $this->queryXml($url, $apiServiceFilterContext);

        $this->checkValidContext($xml->list[self::CO_XML_ATTRIBUT_VALID_CONTEXT]);

        $filterParamters = $apiServiceFilterContext->getParametersArray();

        for ($i = 0; $i < count($xml->list->functionaries->functionary); $i++) {
            $functionaryChildEntry = $xml->list->functionaries->functionary[$i];

            if (isset($filterParamters['f_role']) && preg_match('/(' . $filterParamters['f_role'] . ')/', $functionaryChildEntry['role']) == 0) {
                unset($xml->list->functionaries->functionary[$i]);
                $i--;
            } else {
                $functionaryChildEntry->addAttribute('associationid', $aid);
            }
        }

        return $xml->list;
    }