So I need to build an application that will receive xml request and based on that I will have to return the response xml. I know how to send requests and receive the response, b
The general idea is to read in the POST value, parse it as XML, make a business decision on it, build out an XML response according to the API you've decided on, and write it into the response.
Read in the POST value:
$dataPOST = trim(file_get_contents('php://input'));
Parse as XML:
$xmlData = simplexml_load_string($dataPOST);
Then, you would build out an XML string (or document tree, if you wish), and print it out to the response. print() or echo() will do fine.