Possibility to set Name for physical product in xpdm xml

Hi,

I want to set the value of PLM_ExternalID (display Name : Name) in xpdm xml same as that what user gets when a Physical product is created from User interface . Is there an api to get this first and put it into xpdm xml. 

For enovia schema, we have autoname apis that will give us the last used counter. Is there something equivalent for native objects?