Indeed, as flegendre says, the "SmartProperties" utility does this very well.
You can also achieve this kind of processing by using the SolidWorks "Custom Properties" feature that you can find in the task pane. but it's a little more complicated than "SmartProperties"!
But it's not only related to the type of part, (in my example it's the case) but I'm talking about a property that drives an XMl and seems to me that it's what you want!
This property can be any not THAN the type of part...
Or I really don't understand ANYTHING about the question!
@Coyote: Yes, currently I'm using your drop-down method to choose the xml. But it's not clear to users...
For example, when you make a part, in this list you can put "PieceCommerce" and "PieceManufactured". And it's when you launch the Smart that you make your choice. And that every time you relaunch it...
Whereas by going through a template (where the "PieceCommerce" property is entered permanently), the Smart voucher is launched automatically and every time. And what's more, it's blind for the user.