I have an object that contains data from an exported OLAT backup (OLAT is an e-learning tool written in Java).
Now I need to make another 'type' of backup file, namely a Moodle backup file so I can import it into Moodle itself (another e-learning tool written in PHP). So my plan is to create the folder structure needed for the Moodle backup and write the data to the corresponding .xmls and paths.
I know it sounds vague but my question is this: What would be the best course of action for creating these files? For example, I need to make an .xml with this structure:
<?xml version="1.0" encoding="UTF-8"?>
<course id="8" contextid="78">
<shortname>Test Course Short</shortname>
<fullname>Test Course Long</fullname>
<idnumber></idnumber>
<summary></summary>
<summaryformat>1</summaryformat>
<format>topics</format>
<showgrades>1</showgrades>
<newsitems>5</newsitems>
<startdate>1394668800</startdate>
<marker>0</marker>
<maxbytes>0</maxbytes>
<legacyfiles>0</legacyfiles>
<showreports>0</showreports>
<visible>1</visible>
<groupmode>0</groupmode>
<groupmodeforce>0</groupmodeforce>
<defaultgroupingid>0</defaultgroupingid>
<lang></lang>
<theme></theme>
<timecreated>1394632991</timecreated>
<timemodified>1394632991</timemodified>
<requested>0</requested>
<enablecompletion>0</enablecompletion>
<completionnotify>0</completionnotify>
<numsections>8</numsections>
<hiddensections>0</hiddensections>
<coursedisplay>0</coursedisplay>
<category id="1">
<name>Miscellaneous</name>
<description>$@NULL@$</description>
</category>
<tags>
</tags>
</course>
I know this sounds like basic PHP, but that's also pretty much what it is. How do I for example make this file with just PHP?