normalize (REXML::Text)

    # File temp/text.rb, line 274
                    def Text::normalize( input, doctype=nil, entity_filter=nil )
                            copy = input.clone
                            # Doing it like this rather than in a loop improves the speed
                            if doctype
                                    copy = copy.gsub( EREFERENCE, '&amp;' )
                                    doctype.entities.each_value do |entity|
                                            copy = copy.gsub( entity.value,
                                                    "&#{entity.name};" ) if entity.value and
                                                            not( entity_filter and entity_filter.include?(entity) )
                                    end
                            else
                                    copy = copy.gsub( EREFERENCE, '&amp;' )
                                    DocType::DEFAULT_ENTITIES.each_value do |entity|
                                            copy = copy.gsub(entity.value, "&#{entity.name};" )
                                    end
                            end
                            copy
                    end