protected void writeChildren(XMLStreamWriter out, Player player,
                                 boolean showAll, boolean toSavedGame)
        throws XMLStreamException {
        if (showAll || toSavedGame || player.owns(this)) {
            for (ExportData data : exportData.values()) {
                data.toXML(out);
            }
            // Only write the features that need specific instantiation,
            // which is currently only those with increments.
            // Fixed features will be added from their origins (usually
            // buildings).
            Turn turn = getGame().getTurn();
            for (Modifier modifier : getModifiers()) {
                if (!modifier.isOutOfDate(turn)) {
                    modifier.toXML(out);
                }
            }

            for (WorkLocation workLocation : getAllWorkLocations()) {
                workLocation.toXML(out, player, showAll, toSavedGame);
            }
            for (BuildableType item : buildQueue.getValues()) {
                out.writeStartElement(BUILD_QUEUE_TAG);
                out.writeAttribute(ID_ATTRIBUTE_TAG, item.getId());
                out.writeEndElement();
            }
            for (BuildableType item : populationQueue.getValues()) {
                out.writeStartElement(POPULATION_QUEUE_TAG);
                out.writeAttribute(ID_ATTRIBUTE_TAG, item.getId());
                out.writeEndElement();
            }
            super.writeChildren(out, player, showAll, toSavedGame);
        }
    }