There's no need to use Apache for a script running from the CLI.
(note... personally, I prefer to use Python for these sort of scripts, as there are so many libraries (eg. BeautifulSoup for XML parsing) to make the tasks easier.)
1. Curl in PHP needs to be installed before you can use it:
then you can use it according to the documentation on the php.net manual 
sudo apt-get install php5-curl
2. Parsing the XML you get from curl:
Now you have the XML from the curl request, this is the point where you need to process it with something like SimpleXML