You could define the needed Moodle Files as PHP classes (with public attributes).
namespace Moodle\Models;
class Course {
protected $id;
protected $contextid;
public $shortname;
public $fullname;
...
}
to fill the Moodle Objects with the OLAT content you could write a little OLAT2Moodle Converter. The Converter would have several functions handling OLAT objects and creating Moodle Objects. You might want to use the factory design pattern for this.
In your factory methods you could use simple arrays to define source attributes for destination attributes and use a general method to fiull your object. Simple example.
function fillObject($sourceObject,$destinationObject,$conversationMap) {
foreach (conversationMap as $destinationAttribute => $sourceAttribute) {
{
$destinationObject->$destinationAttribute = sourceObject->$sourceAttribute;
}
}
$courseConversationMap = array(
'id' => 'id',
'title' => 'coursetitle',
'desc' => 'description',
'start' => 'startDate',
...
);
$OLAT_course_object = getOLAT_i_dont_know_how_you_do_that();
$moodleCourse = new Moodle\Course();
fillObject($OLAT_course_object ,$moodleCourse ,$courseConversationMap);
Now you just define the conversationMaps and put that logic in your factory methods. Then you just iterate over the given OLAT objects and call the factory create methods. Don't be scared - it is not Rocket Science nor Brain Surgery ;-)
Then use some PHP XML Library to convert said classes to XML and simply write the XML Objects to files.
Your Converter would be highly reuseable and you could easily write SomethingElse2Moodle Converters on it's Base.