Saving xml via php

I’ve imported an XML file into flash and edited it there successfully. I’m trying to send the edited version back to the server via PHP - but keep getting the following error:

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()

Can someone PLEASE HELP - I’m really a designer who hasn’t done any coding for many years.

Here’s my send function in flash:

function sendData():void {
trace(“got this far”);
var myData:URLRequest = new URLRequest(“http://mangotang.com/savexml.php”);
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.content = xml.toXMLString();
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, dataOnLoad);
loader.load(myData);
}

and here’s the php file:

<?php
$filename = “notices.xml”;
$thedata = $_POST[‘content’];
$domobject = new DomDocument(‘1.0’,‘utf-8’);
$content = $domobject . $thedata;
$filehandle = fopen($filename, ‘w’);
if(fwrite($filehandle, $content)) echo “writing=Ok&”;
else echo “writing=Error&”
fclose($filehandle);
?>