private function getSerializerFieldType(\DOMElement $field)
    {
        if ($field->getAttribute('type')) {
            return $field->getAttribute('type');
        }

        $xpath = new \DOMXPath($field->ownerDocument);

        $type = $xpath->query('type', $field)->item(0);
        return $type === null ? null : $type->nodeValue;
    }