private function appendItem(\sb\RSS\Item $item)
    {

        $new_item = $this->createElement("item");

        foreach(get_object_vars($item) as $key=>$val){
            if($item->{$key} instanceof \sb\RSS\ItemEnclosure){
                $enclosure = $this->createElement('enclosure');
                foreach($item->{$key} as $n=>$v){
                    $enclosure->setAttribute($n, $v);
                }

                $new_item->appendChild($enclosure);
            }

            if($key == 'categories'){
                foreach($item->{$key} as $category){
                    $new_item->appendChild($this->createNode('category', $category));
                }
            }

            if(is_string($val) && !empty($val)){

                $new_item->appendChild($this->createNode($key, $val, $key == 'description'));
            }
        }

        if(empty($item->guid)){
            $new_item->appendChild($this->createNode('guid', $item->link));
        }

        $this->channel->appendChild($new_item);

    }