# File lib/rubyful_soup.rb, line 304
  def to_s(show_structure_indent=nil)
    attr_strings = []
    attrs.each { |k,v| attr_strings << %{#{k}="#{v}"} if v }
    if self_closing?
      close = ' /'
      closeTag = nil
    else
      close = nil
      closeTag = "</#{name}>"
    end
    indent_increment = show_structure_indent==true ? 0 : show_structure_indent
    if show_structure_indent
      indent_increment += 1 unless @hidden
    end
    contents = render_contents(indent_increment)        
    space = "\n #{' ' * indent_increment}" if show_structure_indent
    if @hidden
      s = contents
    else
      s = []
      attribute_string = ''
      unless attr_strings.empty?
        attribute_string = ' ' + attr_strings.join(' ')
      end
      s.push(space) if show_structure_indent
      s.push("<#{@name}#{attribute_string}#{close}>")
      s.push(contents)
      s.push(space) if closeTag and show_structure_indent
      s.push(closeTag)
      s = s.join('')
    end
    return s
  end