eZContentFunctions::createAndPublishObject() makes use of the fromString() method of the datatype. For a very simple example, see function fromString in kernel/classes/datatypes/ezstring/ezstringtype.php. Good luck! And don't forget to share your enhancement to this datatype ;)