Suppose that the Request Xml, after being constructed, is stored in the variable - $requestXml, and Response XML, after retreival from eBay, is stored in $responseXml.
PHP provides a library function, error_log to log any strings to local log files, or default PHP error logs.
// $requestXml - XML to be logged. var_export(with param- true), returns a parsable String representation of the variable, If the variable is not already a string.
// The param 3 - denotes message is appended to the file destination. A newline is not automatically added to the end of the message string.