For each global element defined within an XSD specification, a control class definition is generated. Within this control class are encode methods that can be used to generate a complete XML document. This is the typical entry point an application program would use to serialize elements into XML.
There are two different encode methods that can be used. There is a method named encode that is defined in the OSXSDGlobalElement base class. This method encodes the data in the class instance into the default message buffer or stream that was associated with the control class when it was created. The second method is encodeTo which allows a message buffer or stream to be specified as an argument. The data in the associated class instance is serialized out to this buffer or stream.