I need to write a PHP page which would accept an XML document sent over a POST request like this:
POST /mypage.php HTTP/1.1 Host: myhost.com Content-Type: ap
Try the $HTTP_RAW_POST_DATA variable or the php://input stream.