name is argument of function (Detachxref "name")
xref is localized variable defined in function (Detachxref "name")
Function (Detachxref "name") is correct, you call it with (Detachxref "name") where "name" is user specified string representing DWG name of xref already attached in main DWG and if present, function will detach it, or if not, nothing will be processed...