+ el1['comments_count'] = self.comments.count.to_s
+
+ if include_discussion
+ el2 = XML::Node.new('discussion')
+ self.comments.includes(:author).each do |comment|
+ el3 = XML::Node.new('comment')
+ el3['date'] = comment.created_at.xmlschema
+ el3['uid'] = comment.author.id.to_s if comment.author.data_public?
+ el3['user'] = comment.author.display_name.to_s if comment.author.data_public?
+ el4 = XML::Node.new('text')
+ el4.content = comment.body.to_s
+ el3 << el4
+ el2 << el3
+ end
+ el1 << el2
+ end
+