Converts a list into an XML string.
968359
def convert_list(items, ids, parent, attr_type, item_func, cdata):
    """"""
    LOG.info('Inside convert_list()')
    output = []
    addline = output.append

    item_name = item_func(parent)

    if ids:
        this_id = get_unique_id(parent)

    for i, item in enumerate(items):
        LOG.info('Looping inside convert_list(): item="%s", item_name="%s", type="%s"' % (
            unicode_me(item), item_name, type(item).__name__)
        )
        attr = {} if not ids else { 'id': '%s_%s' % (this_id, i+1) }
        if isinstance(item, numbers.Number) or type(item) in (str, unicode):
            addline(convert_kv(item_name, item, attr_type, attr, cdata))
            
        elif hasattr(item, 'isoformat'): # datetime
            addline(convert_kv(item_name, item.isoformat(), attr_type, attr, cdata))
            
        elif type(item) == bool:
            addline(convert_bool(item_name, item, attr_type, attr, cdata))
            
        elif isinstance(item, dict):
            if not attr_type:
                addline('<%s>%s</%s>' % (
                    item_name, 
                    convert_dict(item, ids, parent, attr_type, item_func, cdata),
                    item_name, 
                    )
                )
            else:
                addline('<%s type="dict">%s</%s>' % (
                    item_name, 
                    convert_dict(item, ids, parent, attr_type, item_func, cdata),
                    item_name, 
                    )
                )

        elif isinstance(item, collections.Iterable):
            if not attr_type:
                addline('<%s %s>%s</%s>' % (
                    item_name, make_attrstring(attr), 
                    convert_list(item, ids, item_name, attr_type, item_func, cdata),
                    item_name, 
                    )
                )
            else:
                addline('<%s type="list"%s>%s</%s>' % (
                    item_name, make_attrstring(attr), 
                    convert_list(item, ids, item_name, attr_type, item_func, cdata),
                    item_name, 
                    )
                )
                
        elif item is None:
            addline(convert_none(item_name, None, attr_type, attr, cdata))
            
        else:
            raise TypeError('Unsupported data type: %s (%s)' % (
                item, type(item).__name__)
            )
    return ''.join(output)
414310
private void _serializeList(List list, StringBuilder sb, Set<Object> done) throws ConverterException {

	sb.append(goIn());
	sb.append("[");
	boolean doIt = false;
	ListIterator it = list.listIterator();
	while (it.hasNext()) {
	    if (doIt) sb.append(',');
	    doIt = true;
	    _serialize(it.next(), sb, done);
	}

	sb.append(']');
    }
313300
def to_xml_string(str = '')
      return if empty?
      str << "<bookViews>"
      each { |view| view.to_xml_string(str) }
      str << '</bookViews>'
    end
816331
def to_xml_string(str = '')
      str << ('<c:axId val="' << @id.to_s << '"/>')
      @scaling.to_xml_string str
      str << ('<c:delete val="' << @delete.to_s << '"/>')
      str << ('<c:axPos val="' << @ax_pos.to_s << '"/>')
      str << '<c:majorGridlines>'
      # TODO shape properties need to be extracted into a class
      if gridlines == false
        str << '<c:spPr>'
        str << '<a:ln>'
        str << '<a:noFill/>'
        str << '</a:ln>'
        str << '</c:spPr>'
      end
      str << '</c:majorGridlines>'
      @title.to_xml_string(str) unless @title == nil
      # Need to set sourceLinked to 0 if we're setting a format code on this row
      # otherwise it will never take, as it will always prefer the 'General' formatting
      # of the cells themselves
      str << ('<c:numFmt formatCode="' << @format_code << '" sourceLinked="' << (@format_code.eql?('General') ? '1' : '0') << '"/>')
      str << '<c:majorTickMark val="none"/>'
      str << '<c:minorTickMark val="none"/>'
      str << ('<c:tickLblPos val="' << @tick_lbl_pos.to_s << '"/>')
      # TODO - this is also being used for series colors
      # time to extract this into a class spPr - Shape Properties
      if @color
        str << '<c:spPr><a:ln><a:solidFill>'
        str << ('<a:srgbClr val="' << @color << '"/>')
        str << '</a:solidFill></a:ln></c:spPr>'
      end
      # some potential value in implementing this in full. Very detailed!
      str << ('<c:txPr><a:bodyPr rot="' << @label_rotation.to_s << '"/><a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr><a:endParaRPr/></a:p></c:txPr>')
      str << ('<c:crossAx val="' << @cross_axis.id.to_s << '"/>')
      str << ('<c:crosses val="' << @crosses.to_s << '"/>')
    end
628565
def read_string_table(xml_source):
    """"""
    strings = []
    src = _get_xml_iter(xml_source)

    for _, node in iterparse(src):
        if node.tag == '{%s}si' % SHEET_MAIN_NS:

            text = Text.from_tree(node).content
            text = text.replace('x005F_', '')
            strings.append(text)

            node.clear()

    return IndexedList(strings)
917280
def to_xml_string(str='')
      return if empty?
      str << '<hyperlinks>'
      each { |hyperlink| hyperlink.to_xml_string(str) }
      str << '</hyperlinks>'
    end
849140
def serialize_for_reading(element):
    
    xml = etree.tostring(element, encoding='unicode', pretty_print=True)
    return XmlString(xml)
933400
def get_list_from_xml(elem, tag="option", attributes=["name"]):
    '''
    
    '''
    return flatten(([option.get(attr) for attr in attributes] + [option.text] for option in elem.findall(tag)), exclude=[None])
21908
def to_xml
      xml = %(<method name="#{@name}">\n)
      @params.each do |param|
        name = param.name ? %(name="#{param.name}" ) : ""
        xml += %(<arg #{name}direction="in" type="#{param.type}"/>\n)
      end
      @rets.each do |param|
        name = param.name ? %(name="#{param.name}" ) : ""
        xml += %(<arg #{name}direction="out" type="#{param.type}"/>\n)
      end
      xml += %(</method>\n)
      xml
    end
429678
def to_xml_string(str='')
      add_worksheet(name: 'Sheet1') unless worksheets.size > 0
      str << '<?xml version="1.0" encoding="UTF-8"?>'
      str << ('<workbook xmlns="' << XML_NS << '" xmlns:r="' << XML_NS_R << '">')
      str << ('<workbookPr date1904="' << @@date1904.to_s << '"/>')
      views.to_xml_string(str)
      str << '<sheets>'
      if is_reversed
        worksheets.reverse_each { |sheet| sheet.to_sheet_node_xml_string(str) }
      else
        worksheets.each { |sheet| sheet.to_sheet_node_xml_string(str) }
      end
      str << '</sheets>'
      defined_names.to_xml_string(str)
      unless pivot_tables.empty?
        str << '<pivotCaches>'
        pivot_tables.each do |pivot_table|
          str << ('<pivotCache cacheId="' << pivot_table.cache_definition.cache_id.to_s << '" r:id="' << pivot_table.cache_definition.rId << '"/>')
        end
        str << '</pivotCaches>'
      end
      str << '</workbook>'
    end
1145357
def to_xml_string(str = '')
      str << '<xdr:oneCellAnchor>'
      str << '<xdr:from>'
      from.to_xml_string(str)
      str << '</xdr:from>'
      str << ('<xdr:ext cx="' << ext[:cx].to_s << '" cy="' << ext[:cy].to_s << '"/>')
      @object.to_xml_string(str)
      str << '<xdr:clientData/>'
      str << '</xdr:oneCellAnchor>'
    end
526359
def to_xml_string(str = '')
      valid_attributes = get_valid_attributes

      str << '<dataValidation '
      str << instance_values.map do |key, value| 
        '' << key << '="' << Axlsx.booleanize(value).to_s << '"' if (valid_attributes.include?(key.to_sym) && !CHILD_ELEMENTS.include?(key.to_sym)) 
      end.join(' ')
      str << '>'
      str << ('<formula1>' << self.formula1 << '</formula1>') if @formula1 and valid_attributes.include?(:formula1)
      str << ('<formula2>' << self.formula2 << '</formula2>') if @formula2 and valid_attributes.include?(:formula2)
      str << '</dataValidation>'
    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
507233
def to_string(self, indent="", newl="", addindent=""):
        '''
        
        '''
        buf = StringIO()
        self.to_xml().writexml(buf, indent=indent, addindent=addindent,
                               newl=newl)
        return buf.getvalue()
313343
def to_xml_string(self):
        

        self.update_xml_element()
        xml = self.xml_element

        return etree.tostring(xml, pretty_print=True).decode('utf-8')
281626
def _to_xml_string(line_prefix, options)
      eol = options[:eol]

      s = ""
      s << line_prefix << ?<
      s << "#{namespace}:" unless namespace.empty?
      s << name

      # output namespace declarations
      uri_by_namespace = options[:uri_by_namespace]
      if uri_by_namespace
        uri_by_namespace.each_pair do |namespace, uri|
          if namespace
            s << " xmlns:#{namespace}=\"#{uri}\""
          else
            s << " xmlns=\"#{uri}\""
          end
        end
      end
      
      # output values
      unless @values.empty?
        i = 0
        @values.each do |value|
          s << " _val" << i.to_s << "=\"" << SDL4R.format(value, false) << "\""
          i += 1
        end
      end
      
      # output attributes
      if has_attribute?
        omit_null_attributes = options[:omit_null_attributes]
        attributes do |attribute_namespace, attribute_name, attribute_value|
          unless omit_null_attributes and attribute_value.nil?
            s << " "
            s << "#{attribute_namespace}:" unless attribute_namespace.empty?
            s << attribute_name << "=\"" << SDL4R.format(attribute_value, false) << ?"
          end
        end
      end
  
      if @children.empty?
        s << "/>"
      else
        s << ">" << eol
        @children.each do |child|
          s << child._to_xml_string(line_prefix + options[:indent], options) << eol
        end
        
        s << line_prefix << "</"
        s << "#{namespace}:" unless namespace.empty?
        s << name << ?>
      end
  
      return s
    end
1243948
def to_xml(self, root):
        '''
        
        '''
        if not len(self.__custom_elements):
            return

        for uri, tags in self.__custom_elements.items():
            prefix, url = uri.split(":", 1)
            for name, value in tags.items():
                self.__createElementNS(root, url, prefix + ":" + name, value)

        return root