Spontaneous localization of bulk matter fields