def xmlencode(s):
 return _encre.sub((lambda m: ('&#%d;' % ord(m.group(1)))), s)

def xmlencode ( s ) : return _encre . sub ( ( lambda m : ( '&#%d;' % ord ( m . group ( 1 ) ) ) ) , s )
encode the given string for inclusion in a utf-8 xml document .