get($opt); // Here we get the elements from children of customers markup "customer" $resources = $xml->customers->children(); } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error'; } // We set the Title echo "

Customer's List

"; echo ''; // if $resources is set we can lists element in it otherwise do nothing cause there's an error if (isset($resources)) { echo ''; foreach ($resources as $resource) { // Iterates on the found IDs echo ''; } } echo '
Id
'.$resource->attributes().'
'; ?>