# File lib/jabber4r/protocol.rb, line 370
      def to_xml
        e = XMLElement.new("presence")
        e.add_attribute("id", @id) if @id
        e.add_attribute("from", @from) if @from
        e.add_attribute("to", @to) if @to
        e.add_attribute("type", @type) if @type
        e.add_child("show").add_data(@show) if @show
        e.add_child("status").add_data(@status) if @status
        e.add_child("priority") if @priority
        e.to_s
      end