When content types are created with public API, XMLText field types get a default value (an empty section element).
When creating content of one of this types without setting a value for an XMLText field, the following error is sometimes thrown :
Warning: eZ\Publish\Core\FieldType\XmlText\Type::isEmptyValue(): Invalid State Error
What happens is type class gets initialized with default value, a DomDocument with no documentElement.
I thought it was caused by the fact that DomDocument is not serializable when retreiving content types' field definitions from cache and tried to make FieldType\XmlText\Value implement \Serializable interface but it did not fix it...