Since all the module resources are merged into Titanium project and there is no access to R class here, we can only fetch the resource ids using Resources.getIdentifier() which is not an efficient way to retrieve resources. In addition, getIdentifier() may return 0 which means the resource is not found. This can happen when the resource file is removed / changed / overwritten by the developer on purpose or by accident. Therefore, I don't think it's a good idea to use a XML layout file here instead of programmatically creating the layout.