I do not think that you can create CodeLists purely based on the .xpt data. Not all CodeList item values might be part of the data in a specific trial.
Also, for ValueLists I do not see how you can create that from the .xpt file in an automated way.
ValueLists may be nested, which is not evident from the .xpt files alone. You will need to know which Items need a ValueList. And how do you get all ItemDef attributes associated with the values from the .xpt files ?? (DataType, Origin, CodeList, …).
It would be great if a define.xml can be created almost with a push on the button. Reality is that you will need to manage most of the metadata that becomes part of the define.xml.
Hope this helps.
Lex Jansen
Disclaimer: these posts represent my own opinion and not necessarily those of my employer (SAS) or CDISC.