Trim the XML content before performing request

This prevents any issues with PUT requests where the XML body was encoded with safe_encode
and the whitespace caused the request to fail.