Index: trunk/src/scriptbuilder/structures/TimeSlice.java
===================================================================
--- trunk/src/scriptbuilder/structures/TimeSlice.java	(revision 16)
+++ trunk/src/scriptbuilder/structures/TimeSlice.java	(revision 21)
@@ -1,7 +1,10 @@
 package scriptbuilder.structures;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
+import java.util.TimeZone;
 import scriptbuilder.gui.ScriptBuilderGuiConstants;
 import scriptbuilder.structures.events.I_ScriptEvent;
@@ -16,8 +19,12 @@
  * @version 2017/06/30
  */
-public class TimeSlice implements Comparable
+public class TimeSlice implements Comparable, I_XML_Writable
 {
 
-    //Events which occur at this instance
+    /**
+     * Reference to the incident which contains this timeslice.
+     */
+    private ScriptIncident thisIncident;
+
     /**
      * List of Script Events which begin at this instance.
@@ -33,8 +40,9 @@
      * that this timeslice occurs
      */
-    public TimeSlice(int seconds)
+    public TimeSlice(int seconds, ScriptIncident inc)
     {
         this.seconds = seconds;
         events = new ArrayList<I_ScriptEvent>();
+        thisIncident = inc;
     }
 
@@ -183,17 +191,54 @@
             return 0;
         }
-
-    }
-
-    /**
-     * Stub method. Converts the contents of this timeslice to a correctly
+    }
+
+    /**
+     * Converts the contents of this timeslice to a correctly
      * formatted <ScriptEvent> XML element.
      *
      * @return XML conversion of this timeslice.
      */
+    @Override
     public String toXML()
     {
-        // stub
-        return "<EVENT GROUP>STUB</EVENT GROUP>";
+        System.out.println("Seconds:: " + seconds);
+        String output = openTag(ELEMENT.SCRIPT_EVENT.tag);
+        SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
+        df.setTimeZone(TimeZone.getTimeZone("GMT"));
+        output += openTag(ELEMENT.TIME_INDEX.tag) + df.format(new Date(seconds * 1000))
+                + closeTag(ELEMENT.TIME_INDEX.tag);
+
+        output += openTag(ELEMENT.INCIDENT.tag + " LogNum=\"" + thisIncident.number + "\"");
+        output += thisIncident.name + closeTag(ELEMENT.INCIDENT.tag);
+
+        for (I_ScriptEvent ev : events)
+        {
+            if (ev instanceof I_XML_Writable)
+            {
+                I_XML_Writable ex = (I_XML_Writable) ev;
+                output += ex.toXML();
+            }
+        }
+        output += closeTag(ELEMENT.SCRIPT_EVENT.tag);
+        System.out.println(output);
+        return output;
+    }
+
+    @Override
+    public String openTag(String s)
+    {
+        return "<" + s + ">\n";
+    }
+
+    @Override
+    public String closeTag(String s)
+    {
+        return "</" + s + ">\n";
+    }
+
+    @Override
+    public String emptyTag(String s)
+    {
+        return "<" + s + "/>\n";
     }
 }
