Nearest Node

Hi All,

               how to select Nearest node to one has coordinates(x,y,z) and how to do it  by scripting code i search for a solution for this problem any one can help me.

                                                                                                                                                              best wishes