I'm having a bit of a problem trying to figure out how to accomplish the following:

I have these two time table blocks as below and I want to read content from an XML file to populate them using PHP.

Using the following XML to populate the blocks:

Code:
    ....

<entry id="1">
    <block1>
        <name>Class 1</name>
        <start>12:00</start>
        <end>2:00</end>
    </block1>
</entry>

<entry id="2">
    <block2>
        <name>Class 1</name>
        <start>12:00</start>
        <end>1:00</end>
    </block2>
</entry>

<entry id="3">
    <block1>
        <name>Class 2</name>
        <start>2:00</start>
        <end>3:30</end>
    </block1>
</entry>

    ....
So the outcome would be:
http://imgur.com/4JKQDBP

The problem I'm having is I can't figure out how to dynamically fill in the blocks based on the XML. I was thinking about slicing up each block into equal parts (maybe by 15 minutes) then filling them in depending on the length of each class but I feel there would be an easier way of doing so and I want to overlay the name over each block (so it might be easier to have full blocks not multiple small ones combined). I think I'll be using simpleXML to check the names of each block from the XML to know which block to fill but can't figure out how to set the times so could do with some tips on where to start. Sorry if this is a bit unclear, I can elaborate if needed.