if I have a class that looks like the following:
class myObject
{
private listOtherObjects;
public function __construc() {
$this->listOtherObjects = new Array();
}
public function addOtherObject($o) {
$this->listOtherObjects[] = $o;
}
}
What I would like is to have a method / function that would convert an instance of this class into xml which looks somewhat like the following:
<myObject>
<listOtherObjects>
<otherObject />
</listOtherObjects>
</myObject>
What would be the best way to go about acheiving this?