module Hpricot

def xchr(str)

XML escaped version of chr
def xchr(str)
  n = XChar::CP1252[str] || str
  case n when *XChar::VALID
    XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
  else
    '*'
  end
end