public function hashToFieldValue($fieldValue, array $context = array())
    {
        if (is_string($fieldValue)) {
            $xmlText = $fieldValue;
        } else if (is_array($fieldValue) && isset($fieldValue['xml'])) {
            // native export format from eZ
            $xmlText = $fieldValue['xml'];
        } else {
            $xmlText = $fieldValue['content'];
        }

        // Check if there are any references in the xml text and replace them. Please phpstorm.
        $resolver = $this->referenceResolver;
        /** @var EmbeddedReferenceResolverInterface $resolver */
        return $resolver->resolveEmbeddedReferences($xmlText);
    }