Document doc = new Document(root);
Element songsElement = new Element("songs");
for(int i = 0; i < songs.size(); i++)
{
JPowerHourSong song = songs.get(i);
Element songElement = new Element("jPowerHourSong");
songElement.setAttribute("index", i+"");
try
{
songElement.setAttribute("path", song.getSongFile().getCanonicalPath());
}
catch (IOException e)
{
e.printStackTrace();
}
songElement.setAttribute("start",song.getStartTime()+"");
songElement.setAttribute("length", song.getPlayLengthMs()+"");
songsElement.addContent(songElement);
}
root.addContent(songsElement);
Element interludesElement = new Element("interludes");