tbh, i would be muuuuch happier with an  xmltv.xml  template instead of doing this programmaticly. So much more simple to just write the tags :)