* the <code>TextDocument</code> instance that defines the structure of the
* payload. If <code>null</code>, this <code>JmsMessage</code> will be in an
* invalid state, meaning it cannot be deployed to a server.
*/
public void setPayloadStructure(TextDocument doc) {
TextDocumentId newId = (doc != null) ? doc.getID() : null;
TextDocumentId oldId = getPayloadTextDocumentId();
boolean change = !KongaID.areEqual(newId, oldId) || (getPayloadStructureType() != PayloadStructureType.TEXT);
XmlStructure oldXmlStructure = xmlPayloadStructure;
setPayloadStructureImpl(newId);
if (change) {
firePropertyChange(PAYLOAD_STRUCTURE, (oldId != null) ? oldId : oldXmlStructure, newId);