def entry_xml(title = '', content = '', categories = [], draft = 'no', updated = '', author_name = @user_id)
      builder = Nokogiri::XML::Builder.new(encoding: 'utf-8') do |xml|
        xml.entry('xmlns'     => 'http://www.w3.org/2005/Atom',
                  'xmlns:app' => 'http://www.w3.org/2007/app') do
          xml.title title
          xml.author do
            xml.name author_name
          end
          xml.content(content, type: 'text/x-markdown')
          xml.updated updated unless updated.empty? || updated.nil?
          categories.each do |category|
            xml.category(term: category)
          end
          xml['app'].control do
            xml['app'].draft draft
          end
        end
      end

      builder.to_xml
    end
def entry_xml(title = '', content = '', categories = [], draft = 'no', updated = '', author_name = @user_id)
      builder = Nokogiri::XML::Builder.new(encoding: 'utf-8') do |xml|
        xml.entry('xmlns'     => 'http://www.w3.org/2005/Atom',
                  'xmlns:app' => 'http://www.w3.org/2007/app') do
          xml.title title
          xml.author do
            xml.name author_name
          end
          xml.content(content, type: 'text/x-markdown')
          xml.updated updated unless updated.empty? || updated.nil?
          categories.each do |category|
            xml.category(term: category)
          end
          xml['app'].control do
            xml['app'].draft draft
          end
        end
      end

      builder.to_xml
    end
Build a entry XML from arguments.
 @param [String] title entry title
 @param [String] content entry content
 @param [Array] categories entry categories
 @param [String] draft this entry is draft if 'yes', otherwise it is not draft
 @param [String] updated entry updated datetime (ISO 8601)
 @param [String] author_name entry author name
 @return [String] XML string