Custom encode function. func is the name of the function which must be present as child.
See Implementation
Custom encode function. func is the name of the function which must be present as child.