978: def to_xml(format, indent=0)
979: result = ""
980: result += " "*indent if format
981: result += "<#{@tag}"
982: @attributes.each {|attrib, value| result += (' '+attrib.to_s+'="'+value.to_s+'"') }
983: if @data=="" and @elements.size==0
984: result +="/>"
985: result +="\n" if format
986: return result
987: end
988: result += ">"
989: result += "\n" if format and @data==""
990: result += @data if @data!=""
991: @elements.each {|element| result+=element.to_xml(format, indent+4)}
992: result += @xml if not @xml.nil?
993: result += " "*indent if format and @data==""
994: result+="</#{@tag}>"
995: result+="\n" if format
996: return result
997: end