I exactly used this , but still I have problem with this error:
'str' object has no attribute 'XMin' 
Sorry about that, here's an example of the code that does not work (it worked at 9.x):
def Origin(ext):
  ext = ext.split()
  return "%s %s" % (ext[0], ext[1])
Since extent is now handled as a full-fledged object, you can fix this code by either converting it to a string:
def Origin(ext):
  ext = str(ext).split()
  return "%s %s" % (ext[0], ext[1])
or requesting the extent object properties directly (probably the best way):
def Origin(ext):
  return "%s %s" % (ext.XMin, ext.YMin)