protected function _putRelated(& $transport, $alias, & $object, & $payloadElement) {
        if (is_array($payloadElement)) {
            if (is_object($object) && $object instanceof xPDOObject) {
                if (isset ($this->payload['related_object_attributes'][$alias]) && is_array($this->payload['related_object_attributes'][$alias])) {
                    $payloadElement = array_merge($payloadElement, $this->payload['related_object_attributes'][$alias]);
                }
                elseif (isset ($this->payload['related_object_attributes'][$object->_class]) && is_array($this->payload['related_object_attributes'][$object->_class])) {
                    $payloadElement = array_merge($payloadElement, $this->payload['related_object_attributes'][$object->_class]);
                }
                $payloadElement['class'] = $object->_class;
                $nativeKey = $object->getPrimaryKey();
                $payloadElement['object'] = $object->toJSON('', true);
                $payloadElement['guid'] = md5(uniqid(rand(), true));
                $payloadElement['native_key'] = $nativeKey;
                $payloadElement['signature'] = md5($object->_class . '_' . $payloadElement['guid']);
                $relatedObjects = array ();
                foreach ($object->_relatedObjects as $rAlias => $related) {
                    if (is_array($related)) {
                        foreach ($related as $rKey => $rObj) {
                            if (!isset ($relatedObjects[$rAlias]))
                                $relatedObjects[$rAlias] = array ();
                            $guid = md5(uniqid(rand(), true));
                            $relatedObjects[$rAlias][$guid] = array ();
                            $this->_putRelated($transport, $rAlias, $rObj, $relatedObjects[$rAlias][$guid]);
                        }
                    }
                    elseif ($related instanceof xPDOObject) {
                        if (!isset ($relatedObjects[$rAlias]))
                            $relatedObjects[$rAlias] = array ();
                        $guid = md5(uniqid(rand(), true));
                        $relatedObjects[$rAlias][$guid] = array ();
                        $this->_putRelated($transport, $rAlias, $related, $relatedObjects[$rAlias][$guid]);
                    }
                }
                if (!empty ($relatedObjects))
                    $payloadElement['related_objects'] = $relatedObjects;
            }
        }
    }