I think it’s doable but not sure if I can build all aspects of a SCHEMA.XML file again. Probably can’t build an ONET.XML as there are things that are created at site creation time which you wouldn’t know about through properties and there are some things missing in the object model that would be able to extra the information.