######################################################################
# Enhance the String class with a XML escaped character version of
# to_s.
#
#:nodoc:
# XML escaped version of to_s
unpack('U*').map {|n| n.xchr}.join # ASCII, UTF-8
rescue
unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
end
end
