@Override
        public void serialize(WriteBuffer writeBuffer) throws SerializationException {
            writeBuffer.pushContext("PlcListModifiable");
            for (PlcValue listItem : listItems) {
                if (!(listItem instanceof Serializable)) {
                    throw new PlcRuntimeException("Error serializing. List item doesn't implement XmlSerializable");
                }
                ((Serializable) listItem).serialize(writeBuffer);
            }
            writeBuffer.popContext("PlcListModifiable");
        }
Little helper that helps avoid the problem, that the elements of a PlcList
cannot be modified after being created.
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7light/readwrite/optimizer/S7Optimizer.java