private function loopMessage(array &$message, \SimpleXMLElement $xml, array &$errors): array
    {
        // init
        $groupedEdi = [];
        $segmentIdx = 0;

        foreach ($xml->children() as $elm) {
            if ($elm->getName() == "group") {
                $this->processXmlGroup($elm, $message, $segmentIdx, $groupedEdi, $errors);
            } elseif ($elm->getName() == "segment") {
                $this->processXmlSegment($elm, $message, $segmentIdx, $groupedEdi, $errors);
            }
        }

        if ($segmentIdx != \count($message)) {
            $errors[] = [
                "text" => $this->messageTextConf['NOTCONFORMANT'],
            ];
        }

        return ['message' => $groupedEdi, 'errors' => $errors];
    }