public <T extends FieldValue> void read(FieldBase field, Array<T> value) {
        try {
            while (reader.hasNext()) {
                int type = reader.next();

                if (type == XMLStreamReader.START_ELEMENT) {
                    if ("item".equals(reader.getName().toString())) {
                        FieldValue fv = (value.getDataType()).getNestedType().createFieldValue();
                        deserializeFieldValue(field, fv);
                        // noinspection unchecked
                        value.add((T)fv);
                        skipToEnd("item");
                    }
                } else if (type == XMLStreamReader.END_ELEMENT) {
                    return;
                }
            }
        } catch (XMLStreamException e) {
            throw newException(field, e);
        }
    }
Optional test and set condition. Common for document/update/remove elements
This variable is either set in VespaXMLFieldReader#read (reader for document)
or in VespaXMLUpdateReader#read (reader for update).
document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLFieldReader.java