The MCS Norway team has done a good job of documenting the SharePoint element provisioning order, as part of their SiteConfigurator available at CodePlex:
"There are several steps in the creation process and SharePoint provisions in the following order:Here are some gotchas related to SPSPERS customization:
This is a fairly complex process and it can often be hard to know the method for customizing a site definition. A solution can be right in one scenario and completely wrong in another, making this somewhat confusing."
- Global onet.xml This file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment.
- SPSite scoped features defined in site definitions onet.xml, in the order they are defined in the file. The onet.xml file defined in the site definition can define navigational areas, list templates, document templates, configurations, modules, components, and server e-mail footers used in the site definition to which it corresponds.
- SPSite scoped stapled features, in quasi random order
- SPWeb scoped features defined in onet.xml, in the order they are defined in the file.
- SPWeb scoped stapled features, in quasi random order
- List instances defined in onet.xml
- Modules defined in onet.xml
- The doc-libs Shared Documents and Personal Documents do not exist yet during feature stapling; list instances in onet.xml are provisioned in step 6.
- The my content home page default.aspx do not exist yet during feature stapling; files and pages in onet.xml are provisioned in step 7.
- Do not create your own customized default.aspx file, it will get filled with the standard web-parts when the file's AllUsersWebParts are provisioned by the onet.xml module in step 7.
- The quick launch heading node titles are not yet localized during site provisioning, look them up by their id rather than their title when adding links
- The standard BlogView web-part only works when in a site page in the site root, it won't work in pages stored in lists, doc-libs or custom folders.
- The Wiki Page Home Page feature is not activated by default for personal sites; do not provision your own /SitePages/ custom list, doc-lib or folder, as this will prevent enabling wiki pages later on.
I strongly recommend using or learning from the SiteConfigurator, download the feature and the source code from CodePlex and join the community there.