The .vmx file contains guestOS = "winxppro" attribute. This attribute can be used to determine the guest operating system. Is this attribute is auto detected by VMware or it depends on the selection of the OS type by the user?
It depends on the OS you select when creating the VM. You can see this by creating a bunch of different guest types - even though they're empty, they'll have different guestOS parameters.
here is an outdated and incomplete overview of your options for parameter "guestOS"
http://sanbarrow.com/vmx/vmx-guestos.html