class Xlement #Store the tag and initialize the array of children def initialize(tag) @tag = tag @sharp_objects = Array.new @attributes = Hash.new #USEME end #Add an element inside this element def swallow(sharp_object) @sharp_objects << sharp_object end #Squeeze it put def heimlich() print '<', @tag, '>' @sharp_objects.each do |sharp_object| if sharp_object.respond_to? :heimlich sharp_object.heimlich else print sharp_object if sharp_object.respond_to? :to_s end end print '</', @tag, '>' endend