Can this be done? I dont want to lose no data or getting errors.
I am interested in using latest xcode for developing apps.
Not legally!
It is a violation of Apple's licensing to run their OS on non-Apple hardware. VMware could get into legal trouble if we help you here.
Plus, you need to hack the Workstation/Player software in order to run Mac OS as a guest - why would you come to a company's site and admit you hacked their software and ask for help with it?
If it is illegal than why do you support the os on vmware?
Virtualizing Mac OS can only be done legally on Apple branded hardware.
VMware supports Apple OS guests only with VMware Fusion, running on MacOS on Apple Desktops/laptops, and ESXi Server, running on Apple Server hardware.