If you just want to send variables rather than an XML string with your POST request, you can use http_build_query:

curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));

(there’s an example at http://lornajane.net/posts/2009/putting-data-fields-with-php-curl)