4. The method according to claim 3 , further comprising, if an element of said XML-type document is one of a command and an item: appending an opening XML-type fragment representing the element to said buffer; and reserving space in said buffer for a corresponding closing XML-type fragment.
4. The method according to claim 3 , further comprising, if an element of said XML-type document is one of a command and an item: appending an opening XML-type fragment representing the element to said buffer; and reserving space in said buffer for a corresponding closing XML-type fragment. 5. The method according to claim 4 , further comprising, (a) if appending said XML-type fragment to said buffer results in a size limit violation: removing said opening XML-type fragment from said buffer; and notifying a user that the element has not been encoded; (b) if appending said XML-type fragment results in the contents of said buffer being ‘valid’: flushing said buffer to said transport layer; and notifying a user that the element was encoded; (c) if appending said XML-type fragment results in the contents of said buffer being ‘invalid’: not flushing said buffer; and notifying a user that the element has not been encoded.