class String


to_s.
Enhance the String class with a XML escaped character version of
#####################################################################

def to_xs(escape=true)

converted to character entities.
the CP1252 fix is still applied but utf-8 characters are not
XML escaped version of to_s. When escape is set to false
def to_xs(escape=true)
  unpack('U*').map {|n| n.xchr(escape)}.join # ASCII, UTF-8
rescue
  unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
end