Serialize the array value and add it to the array parent element.

def _serialize(
            self,
            array_parent,  # type: ET.Element
            value,  # type: List
            state  # type: _ProcessorState
    ):
        # type: (...) -> None
        """Serialize the array value and add it to the array parent element."""
        if not value:
            # Nothing to do. Avoid attempting to iterate over a possibly
            # None value.
            return

        for i, item_value in enumerate(value):
            state.push_location(self._item_processor.element_path, i)
            item_element = self._item_processor.serialize(item_value, state)
            array_parent.append(item_element)
            state.pop_location()