private void writeChildren(XmlSerializer serializer, Entity rootEntity) throws IOException { List<Node<?>> children = rootEntity.getChildren(); for (Node<?> node : children) { write(serializer, node); } writeEmptyNodes(serializer, rootEntity); }