look in the scripting manual
you need to go to odb.rootAssembly.instaces[].nodes -> coordinates, label.
i think that that exact case is in one of the examples.
Simple example could be found in documentations chapter "9.5.6 Reading field output data". If you want to write only coordinates at initial state then loki3000 gave you very good advice, if you want to write deform state of mesh then you need to take coordinates from initial state and add them to displacements from selected step/frame.