protected function fetchXml($function, $params = array(), $method = self::GET)
{
if (strpos($function, '.php') > 0) {
// no need of api key for php calls
$url = $this->getMirror(self::MIRROR_TYPE_XML) . '/api/' . $function;
} else {
$url = $this->getMirror(self::MIRROR_TYPE_XML) . '/api/' . $this->apiKey . '/' . $function;
}
$data = $this->httpClient->fetch($url, $params, $method);
$simpleXml = $this->getXml($data);
return $simpleXml;
}