Receiver in XML form
 @return [XML::Document] XML of the receiver
497280
def to_xml
      doc      = XML::Document.new('1.0')
      doc.root = XML::Node.new('epp')
      root     = doc.root

      epp_ns   = XML::Namespace.new(root, nil, 'urn:ietf:params:xml:ns:epp-1.0')
      root.namespaces.namespace = epp_ns

      xsi_ns   = XML::Namespace.new(root, 'xsi', 'http://www.w3.org/2001/XMLSchema-instance')
      xsi_sL   = XML::Attr.new(root, 'schemaLocation', 'urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd')
      xsi_sL.namespaces.namespace = xsi_ns

      @namespaces = {'epp' => epp_ns, 'xsi' => xsi_ns}

      @request.set_namespaces(@namespaces) if @request.respond_to?(:set_namespaces)
      root << @request.to_xml

      doc
    end
1172218
def parse(xml)
      xml ||= ''
      xml = StringIO.new(xml) unless xml.respond_to?(:read)

      handler = SaxHandler.new(skip_type_casting: skip_type_casting, known_arrays: known_arrays)
      Ox.sax_parse(handler, xml, convert_special: true)
      handler.to_hash
    end
1019410
def rest_xml
      validate_before_save
      doc = REXML::Document.new APIConnection::XML_HEADER
      webhook = doc.add_element 'webhook'
      webhook.add_element('name').text = @name
      webhook.add_element('enabled').text = @enabled
      webhook.add_element('url').text = @url
      webhook.add_element('content_type').text = CONTENT_TYPES[@content_type]
      webhook.add_element('event').text = @event
      doc.to_s
    end
567052
def xml(self):
        
        rels_elm = CT_Relationships.new()
        for rel in self.values():
            rels_elm.add_rel(
                rel.rId, rel.reltype, rel.target_ref, rel.is_external
            )
        return rels_elm.xml
4624
def to_xml(options = {})
      xml = options[:builder] ||= Builder::XmlMarkup.new
      xml.instruct! unless options[:skip_instruct]
      each do |key, value|
        # Remove leading and trailing whitespace from tag values
        xml.tag(:k => key, :v => coder.decode(value.strip)) unless value.blank?
      end unless empty?
    end
352556
def convert_to_xml_attributes(hash)
      result = {}
      hash.each do |k, v|
        key = k.to_s.gsub('_', '-').to_sym
        result[key] = v
      end
      result
    end
484275
def to_hash
      doc = ::Nokogiri::XML( self.response )
      hash = {}
      doc.at_css("Response").element_children.each do |attribute|
        hash[attribute.name.underscore.to_sym] = attribute.inner_text
      end
      hash[:valid] = doc.at_css("Response")['valid']
      hash
    end
864168
def rest_xml
      doc = REXML::Document.new APIConnection::XML_HEADER
      periph = doc.add_element RSRC_OBJECT_KEY.to_s

      general = periph.add_element('general')
      general.add_element('type').text = @type
      general.add_element('site').add_element('name').text = @site
      general.add_element('bar_code_1').text = @bar_code_1
      general.add_element('bar_code_2').text = @bar_code_2
      general.add_element('computer_id').text = @computer_id

      fields = general.add_element('fields')
      @fields.each do |n,v|
        fld =  fields.add_element('field')
        fld.add_element('name').text = n
        fld.add_element('value').text = v
      end

      if has_location?
        periph << location_xml
      end
      if has_purchasing?
        periph << purchasing_xml
      end
      add_site_to_xml doc

      return doc.to_s
    end
103623
def to_xml(options = {})
      xml = options[:builder] ||= Builder::XmlMarkup.new
      xml.instruct! unless options[:skip_instruct]
      xml.osm(:generator => "rosemary v#{Rosemary::VERSION}", :version => Rosemary::Api::API_VERSION) do
        xml.relation(attributes) do
          members.each do |member|
            member.to_xml(:builder => xml, :skip_instruct => true)
          end
          tags.to_xml(:builder => xml, :skip_instruct => true)
        end
      end
    end
605410
def to_xml(options={})
      options[:indent] ||= 2
      xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
      xml.instruct! unless options[:skip_instruct]

      obj_name = self.class.resource_name.singularize
      
      # Turn our OpenStruct attributes into a hash we can export to XML
      obj_attrs = self.marshal_dump
      
      xml.tag!(obj_name) do
        obj_attrs.each do |key,value|
          next if key.to_sym == :link # Don't feed back links to server
          case value
            when ::Hash
              value.to_xml(
                options.merge({ 
                  :root => key, 
                  :skip_instruct => true 
                })
              )
            when ::Array
              value.to_xml(
                options.merge({ 
                  :root => key, 
                  :children => key.to_s.singularize, 
                  :skip_instruct => true
                })
              )
            else
              xml.tag!(key, value)
          end
        end
      end
    end
1347838
def to_xml(opts={})
      exclude = opts[:exclude] || []
      exclude << :errors
      
      tag     = opts[:tag] || RSpreedly.underscore(self.class.to_s)
      inner   = opts[:inner]
      outer   = opts[:outer]      
      no_tag  = opts[:no_tag]
      
      xml = ""
      xml << "<#{outer}>" if outer
      xml << "<#{tag}>" unless no_tag
      xml << "<#{inner}>" if inner
      self.instance_variables.each do |var|
        name = var.to_s.gsub('@', '')
        next if exclude.include?(name.to_sym)
        value = self.instance_variable_get(var)
        if value.respond_to?(:to_xml)
          value = value.to_xml(:no_tag => (RSpreedly.underscore(value.class.to_s) == name)) 
        end
        xml << "<#{name}>#{value}</#{name}>"
      end
      xml << "</#{inner}>" if inner      
      xml << "</#{tag}>" unless no_tag
      xml << "</#{outer}>" if outer      
      xml
    end
460917
def rest_xml
      doc = REXML::Document.new
      scpt = doc.add_element 'script'

      scpt.add_element('filename').text = @filename
      scpt.add_element('id').text = @id
      scpt.add_element('info').text = @info
      scpt.add_element('name').text = @name
      scpt.add_element('notes').text = @notes
      scpt.add_element('os_requirements').text = JSS.to_s_and_a(@os_requirements)[:stringform]
      scpt.add_element('priority').text = @priority
      add_category_to_xml(doc)

      if @parameters.empty?
        scpt.add_element('parameters').text = nil
      else
        pars = scpt.add_element('parameters')
        PARAMETER_KEYS.each { |p| pars.add_element(p.to_s).text = @parameters[p] }
      end

      scpt.add_element('script_contents_encoded').text = Base64.encode64(@script_contents)

      doc.to_s
    end
636808
def to_xml
      return nil if title.nil? || body.nil?

      xml = ""
      xml << "<d:entry id=\"#{self.id}\" d:title=\"#{self.title}\">\n"
      @index.each do |i|
        xml << "\t<d:index d:value=\"#{i}\" d:title=\"#{title}\" "
        xml << "d:yomi=\"#{yomi}\"" if !self.yomi.nil?
        xml << "/>\n"
      end
      xml << "\t<div>\n"
      xml << "\t\t#{@body}\n"
      xml << "\t</div>\n"
      xml << "</d:entry>\n"

      return xml
    end
1279307
def to_xml(options = {})
      builder = options[:builder] || XML.new("<#{self.class.member_name}/>")
      xml_keys.each { |key|
        value = respond_to?(key) ? send(key) : self[key]
        node = builder.add_element key

        # Duck-typing here is problematic because of ActiveSupport's #to_xml.
        case value
        when Resource, Subscription::AddOns
          value.to_xml options.merge(:builder => node)
        when Array
          value.each do |e|
            if e.is_a? Recurly::Resource
              # create a node to hold this resource
              e_node = node.add_element Helper.singularize(key)
              # serialize the resource into this node
              e.to_xml(options.merge(builder: e_node))
            else
              # it's just a primitive value
              node.add_element(Helper.singularize(key), e)
            end
          end
        when Hash, Recurly::Money
          value.each_pair { |k, v| node.add_element k.to_s, v }
        else
          node.text = value
        end
      }
      builder.to_s
    end
810449
def to_xml(self):
        '''
        
        '''
        for n, v in {"recipient": self.recipient}.items():
            if is_empty_or_none(v):
                raise ValueError("'%s' attribute cannot be empty or None." % n)

        doc = Document()
        root = doc.createElement("shipping")
        root.appendChild(self.recipient.to_xml("recipient"))
        return root
625184
def getXML(self):
        
        s = ''
        for element in self._svgElements:
            s += element.getXML()
        return s
983360
def rest_xml
      doc = REXML::Document.new APIConnection::XML_HEADER
      obj = doc.add_element RSRC_OBJECT_KEY.to_s
      obj.add_element('invitation_type').text = invitation_type
      obj.add_element('create_account_if_does_not_exist').text = create_account_if_does_not_exist
      if expiration_date_epoch
        obj.add_element('expiration_date_epoch').text = expiration_date_epoch
      end
      obj.add_element('ssh_username').text = ssh_username
      obj.add_element('hide_account').text = hide_account
      obj.add_element('invitation_status').text = invitation_status
      obj.add_element('multiple_uses_allowed').text = multiple_uses_allowed
      add_site_to_xml(doc)
      doc.to_s
    end