{
String group = spawnElement.attributeValue("group");
int respawn = spawnElement.attributeValue("respawn") == null ? 60 : Integer.parseInt(spawnElement.attributeValue("respawn"));
int respawnRandom = spawnElement.attributeValue("respawn_random") == null ? 0 : Integer.parseInt(spawnElement.attributeValue("respawn_random"));
int count = spawnElement.attributeValue("count") == null ? 1 : Integer.parseInt(spawnElement.attributeValue("count"));
PeriodOfDay periodOfDay = spawnElement.attributeValue("period_of_day") == null ? PeriodOfDay.NONE : PeriodOfDay.valueOf(spawnElement.attributeValue("period_of_day").toUpperCase());
if (group == null)
{
group = periodOfDay.name();
}
SpawnTemplate template = new SpawnTemplate(periodOfDay, count, respawn, respawnRandom);
for (Iterator<Element> subIterator = spawnElement.elementIterator(); subIterator.hasNext();)
{
Element subElement = subIterator.next();