---
title: A Guide to Packagexml for All Components in Salesforce
canonical: https://packagingdiscussions.com/a-guide-to-packagexml-for-all-components-in-salesforce/
author: Packaging Discussions Editorial Staff
published: 2026-12-22
updated: 2026-12-04
language: en
category: Material and Technology
description: package.xml defines metadata types, members, and API versions; exact naming, syntax, namespaces, and version compatibility are essential for successful retrievals and deployments.
source: Provimedia GmbH
---

# A Guide to Packagexml for All Components in Salesforce

> **Autor:** Packaging Discussions Editorial Staff | **Veröffentlicht:** 2026-12-22 | **Aktualisiert:** 2026-12-04

**Zusammenfassung:** package.xml defines metadata types, members, and API versions; exact naming, syntax, namespaces, and version compatibility are essential for successful retrievals and deployments.

---

## Package.xml Structure and Required Metadata Fields
A Salesforce **package.xml** file is a manifest. It tells the Metadata API which metadata types to retrieve or deploy. The file does not contain Apex code, field settings, or page markup. Instead, it lists component names and the metadata API version used for the operation.

A valid manifest uses this basic shape:

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

  <types>

    <members>Account.Custom_Code__c</members>

    <name>CustomField</name>

  </types>

  <version>65.0</version>

</Package>

The root element must be **Package** and include the required namespace; omitting it usually causes a Metadata API parsing error. Each **types** block describes one metadata type. Put one or more **members** inside it, then identify the type with **name**. The final **version** element sets the API version, not the Salesforce release name.

For example, `65.0` represents the API version available in the Salesforce release that supports it. Use an API version supported by both the source and target orgs. A newer version can expose metadata features that an older target cannot process, while an old version may omit newer properties. The version therefore acts as a compatibility boundary, not just a label.

Member names depend on the metadata type. A custom object uses its API name:

<types>

  <members>Invoice__c</members>

  <name>CustomObject</name>

</types>

A custom field combines the object API name and field API name with a period:

<types>

  <members>Invoice__c.Due_Date__c</members>

  <name>CustomField</name>

</types>

Several members can share one metadata type block. This is cleaner and easier to maintain than creating a separate block for every component:

<types>

  <members>Invoice__c.Due_Date__c</members>

  <members>Invoice__c.Status__c</members>

  <name>CustomField</name>

</types>

XML is case-sensitive. The element must be **members**, not *Members*, and the metadata type must use the exact Metadata API name, such as **ApexClass** rather than “Classes.” Keep the file in UTF-8 format and use a single root element. Comments are allowed in XML, but they add little value in a small manifest and can clutter automated review.

Some metadata types require special member syntax. A profile is referenced by its name, while a custom label is also named directly. A report normally uses its folder and report name, separated by a folder path. These rules are defined per metadata type, so guessing the member format is risky. Check the [Salesforce Metadata API documentation](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_intro.htm) when a component does not follow the usual naming pattern.

A compact manifest can use the wildcard member:

<types>

  <members>*</members>

  <name>ApexClass</name>

</types>

The asterisk requests all components of that metadata type that the operation can access. It does not mean “all metadata in the org.” To request every supported type, each type still needs its own block. Wildcards are useful for broad retrievals, but explicit names create a tighter deployment boundary.

When no members are listed for a type, the manifest is invalid. An empty **types** element is not a harmless placeholder. Remove it or add at least one valid member. Dependencies between components are handled by Salesforce validation and deployment rules, not by adding arbitrary XML fields.

Use this minimal template as a starting point:

<?xml version="1.0" encoding="UTF-8"?>

<Package xmlns="http://soap.sforce.com/2006/04/metadata">

  <types>

    <members>ComponentName</members>

    <name>MetadataType</name>

  </types>

  <version>65.0</version>

</Package>

## Metadata Type Names and Component Members
Each **metadata type** has its own member naming rule. The value inside `<members>` is not always the label shown in Setup. It is usually an API name, a qualified name, or a path-like identifier defined by the Metadata API.

Common exact type names include **ApexClass**, **CustomObject**, **CustomField**, **Layout**, **RecordType**, **PermissionSet**, and **Flow**. Similar Salesforce features can use different metadata types, so a familiar Setup label is not enough to select the correct value.

Member syntax often changes with the component kind:

  - **Standalone components:** use the component API name, such as an Apex class or permission set.

  - **Child components:** qualify the child with its parent, such as *Customer__c.Region__c* for a custom field.

  - **Shared configuration:** use the relevant parent and child names when the platform stores the item below another component.

  - **Folder-based assets:** include the folder path when the metadata type requires it.

  - **Namespaced components:** preserve the namespace prefix where Salesforce expects it.

Do not confuse a display label with an API name. A field labelled “Customer Tier” may be stored as **Customer_Tier__c**. Likewise, a custom object label can differ from its API name, often ending in **__c**. Package.xml works with the metadata identifier, not the text users see on a page.

Some metadata types use compound members. A layout, for example, commonly combines the object API name with the layout name:

*Account-Account Layout*

A record type commonly follows a similar object-qualified pattern:

*Account.Retail*

The separator is significant. A hyphen, period, slash, or other character is part of the member grammar for that type. Replacing it with another separator can produce a “component not found” error even when both names look correct.

Child metadata deserves special care. Retrieving a parent component may return its children in the local project format, but deployment selection still depends on the metadata type’s rules. For example, a custom object may contain fields, record types, business processes, and list views. Selecting only the object does not always express the same intent as selecting each child type explicitly.

Names can also differ between orgs. A component created in a namespaced package, an installed managed package, or an unlocked package may require a namespace-qualified member. Local custom components usually use the subscriber org’s API name. Never remove a prefix simply because it is absent from the visible label.

For reliable member discovery, retrieve a small, known component from the source org and inspect the generated metadata path. That result shows the spelling and qualification Salesforce actually uses. Then compare it with the [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage/overview) before adding the type to a larger manifest.

A useful diagnostic sequence is:

  - Check the exact Metadata API type name.

  - Confirm the component’s API name in Object Manager, Setup, or the retrieved project.

  - Apply the naming pattern required by that type.

  - Check namespace and folder qualification.

  - Verify that the type supports the intended retrieve or deploy operation.

This prevents a common trap: a syntactically valid package.xml can still point to a member that Salesforce cannot resolve. XML validity proves only that the file is well formed; member validity depends on the platform’s metadata catalog.

## Salesforce package.xml Components, Member Syntax, and Deployment Considerations

  
    | 
      Metadata component | 
      Metadata API type | 
      Example member | 
      Important consideration | 
    

  
  
    | 
      Custom object | 
      CustomObject | 
      Invoice__c | 
      Use the object API name, not its display label. | 
    

    | 
      Custom field | 
      CustomField | 
      Invoice__c.Due_Date__c | 
      Combine the object API name and field API name with a period. | 
    

    | 
      Apex class | 
      ApexClass | 
      BillingService | 
      Test classes use the same ApexClass type. | 
    

    | 
      Apex trigger | 
      ApexTrigger | 
      BillingTrigger | 
      Include related classes and tests when required by the deployment. | 
    

    | 
      Lightning Web Component | 
      LightningComponentBundle | 
      invoiceSummary | 
      Select the complete bundle, not individual JavaScript, HTML, or CSS files. | 
    

    | 
      Aura component | 
      AuraDefinitionBundle | 
      invoiceWorkspace | 
      The member represents the entire Aura bundle. | 
    

    | 
      Flow | 
      Flow | 
      Invoice_Approval | 
      Check flow versions, activation state, and referenced actions. | 
    

    | 
      Layout | 
      Layout | 
      Invoice__c-Invoice Layout | 
      Use the object and layout name with the required hyphen format. | 
    

    | 
      Record type | 
      RecordType | 
      Invoice__c.Standard | 
      Use the object API name and record type developer name. | 
    

    | 
      Permission set | 
      PermissionSet | 
      Billing_Manager | 
      Deployment creates the definition; user assignments require a separate step. | 
    

    | 
      Profile | 
      Profile | 
      Billing_Admin | 
      Profile changes can affect many users and should receive careful review. | 
    

    | 
      Permission set group | 
      PermissionSetGroup | 
      Operations_Access | 
      Review included permission sets and muting permission sets. | 
    

    | 
      Report | 
      Report | 
      Finance/Invoice Aging | 
      Include the folder path and verify referenced report types and fields. | 
    

    | 
      Dashboard | 
      Dashboard | 
      Finance/Revenue Overview | 
      Deploy source reports and confirm folder access. | 
    

    | 
      Email template | 
      EmailTemplate | 
      Operations/Invoice Notice | 
      Check folder location, merge fields, and letterhead dependencies. | 
    

    | 
      Custom label | 
      CustomLabel | 
      Invoice_Paid_Message | 
      Use the label API name; translations may require separate metadata handling. | 
    

    | 
      Static resource | 
      StaticResource | 
      invoiceAssets | 
      Verify references from Apex, Visualforce, or Lightning components. | 
    

    | 
      Experience Cloud site | 
      Network or ExperienceBundle | 
      CustomerPortal | 
      Check the site model, guest access, routes, branding, and permissions. | 
    

    | 
      Wildcard selection | 
      Any supported type | 
      * | 
      Retrieves all accessible components of one type, not all metadata in the org. | 
    

    | 
      API version | 
      version | 
      65.0 | 
      Use a version supported by both the source and target orgs. | 
    

  

## Wildcards, Explicit Members, and Version Control
Wildcards and explicit members serve different release goals. Choose between them based on the boundary you want to create, not on which option requires fewer lines.

A wildcard uses ***** as the member value for one metadata type. It is useful when a retrieval should capture the complete current set of that type, such as all Apex classes or all custom labels. It also helps create a baseline from an unfamiliar org.

Wildcards can become unsafe in deployment manifests. A new component may appear in the source after the manifest was created and then enter the deployment without a deliberate review. Deleted or renamed items can create noisy changes as well. For production releases, broad selection is often a blunt instrument.

Explicit members create a fixed allowlist. Only the named components are selected, so the manifest records the intended change set more clearly. This makes code review easier and reduces accidental additions, especially when several teams share one org.

There is a practical middle ground. Use a wildcard for an initial retrieve, inspect the result, and replace it with explicit members for a controlled release. For stable, low-risk metadata, a wildcard may remain suitable. For security settings, automation, and customer-facing configuration, explicit selection usually gives better control.

Version control adds another layer. Store package.xml beside the metadata it selects, and review both as one change. A manifest that lists a component missing from the project is incomplete. A project containing metadata absent from the manifest may be intentionally excluded—or simply forgotten.

Keep separate manifests for separate purposes instead of forcing one file to handle every workflow:

  - **Baseline manifest:** captures a broad org snapshot.

  - **Feature manifest:** contains only the components for one feature or ticket.

  - **Release manifest:** reflects the exact production deployment scope.

  - **Destructive manifest:** identifies metadata scheduled for removal, with extra review.

Do not edit the API version casually. A version change can alter which metadata properties are returned, accepted, or ignored. Treat it as a dependency change: document why it changed, test the manifest against the target org, and review the resulting file differences.

Generated metadata may change ordering or formatting without changing its meaning. Keep manifests consistently ordered by metadata type and member name where possible. Stable ordering makes meaningful changes visible and reduces merge conflicts.

For parallel work, avoid one giant manifest as the only source of truth. Small, purpose-based manifests are easier to merge and revert. Before a release, combine the required selections through the deployment workflow rather than manually copying entries under time pressure.

A useful review asks three questions:

  - Could a new source component enter this deployment without approval?

  - Would a reviewer understand why each selected member belongs here?

  - Does the API version match the capabilities of the target org and deployment tool?

Salesforce documents wildcard behavior and metadata support in its [Metadata API retrieve documentation](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_retrieve.htm). Check the relevant type before relying on a wildcard, because support and retrieval behavior can vary across metadata types and API versions.

## Common Salesforce Components and Their Package.xml Entries
Package.xml entries vary by component family. The examples below show the member patterns used most often in Salesforce projects. Replace the sample names with the API names from your org.

**Apex and Visualforce** use direct component names. Apex classes and triggers are separate metadata types, even when they belong to the same feature.

*BillingService* — **ApexClass**

*BillingTrigger* — **ApexTrigger**

*InvoicePage* — **ApexPage**

*InvoiceController* — **ApexComponent**

**Lightning components** follow bundle-based entries. A Lightning web component is selected through **LightningComponentBundle**; an Aura bundle uses **AuraDefinitionBundle**. Select the bundle name, not each file inside it.

*invoiceSummary* — **LightningComponentBundle**

*invoiceWorkspace* — **AuraDefinitionBundle**

**Custom objects and their configuration** use several related types. The object itself is represented by **CustomObject**. Fields, layouts, record types, and list views can be represented separately, depending on the retrieval or deployment scope.

*Invoice__c* — **CustomObject**

*Invoice__c.Amount__c* — **CustomField**

*Invoice__c-Invoice Layout* — **Layout**

*Invoice__c.Standard* — **RecordType**

*Invoice__c.All* — **ListView**

**Automation** commonly uses **Flow**. The member is the flow’s API name, and activated or inactive versions may be represented in the retrieved metadata. Keep version selection in mind when a release changes an existing flow rather than creating a new one.

*Invoice_Approval* — **Flow**

**Security metadata** has distinct types for permission sets, profiles, permission set groups, and custom permissions. A permission set assignment is not the same metadata as the permission set definition. The manifest selects the definition; assignments usually require a separate deployment or post-deployment step.

*Billing_Manager* — **PermissionSet**

*Billing_Admin* — **Profile**

*Operations_Access* — **PermissionSetGroup**

*Can_Approve_Invoice* — **CustomPermission**

**Reports and dashboards** are folder-aware. Their member values commonly include the folder and asset name, separated by a slash. A dashboard can also depend on reports stored in another folder, so selecting the dashboard alone may not deliver every required source report.

*Finance/Invoice Aging* — **Report**

*Finance/Revenue Overview* — **Dashboard**

**Email assets** use different types for templates, alerts, and letterheads. Email templates commonly include a folder path, while an email alert uses the alert’s API name and is linked to an automation or object through its metadata.

*Operations/Invoice Notice* — **EmailTemplate**

*Invoice_Overdue_Alert* — **EmailAlert**

**Translations, labels, and static resources** have their own entries. A custom label is selected by its API name. A static resource is also selected directly, while translations often represent a wider set of localized values in one metadata file.

*Invoice_Paid_Message* — **CustomLabel**

*invoiceAssets* — **StaticResource**

*de* — **Translations**

Dependencies matter more than the number of entries. A custom field may require its object; a layout can refer to fields and record types; an automation may call Apex or reference custom metadata. Select the related components required to make the feature usable, not merely the files changed in the editor.

The official [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) is the best reference for supported types, member syntax, and operation limits. It also helps distinguish a component that can be deployed independently from one that must travel with a parent.

## Custom Objects, Fields, and Relationships
Custom objects often act as the dependency hub for Salesforce metadata. A single object can own fields, relationships, record types, business processes, compact layouts, search layouts, and list views. For a dependable manifest, map these parts by purpose rather than treating the object as one indivisible file.

Use **CustomObject** for the object definition and **CustomField** for fields that must be selected independently. A field member uses the object API name, followed by a period and the field API name:

*Project__c.Start_Date__c*

Relationships have distinct field types. A lookup relationship uses **Lookup** inside the object metadata, while a master-detail relationship uses **MasterDetail**. Both are represented through the related custom field when selected as a field member. The relationship field alone does not guarantee that every object involved in the relationship is present in the target org.

For example, a custom object may contain these fields:

  - **Project__c.Client__c** — lookup to an account or another custom object

  - **Project__c.Parent_Project__c** — self-lookup relationship

  - **Project__c.Total_Cost__c** — currency field

  - **Project__c.Margin__c** — formula or calculated field

A master-detail relationship introduces a stricter dependency. The detail object relies on its master for ownership, sharing behavior, and roll-up summaries. Deploy the master object and its required relationship structure before adding dependent roll-up summary fields. Otherwise, Salesforce may reject a valid-looking manifest because the referenced relationship is not available at the point of deployment.

Junction objects use two master-detail fields to model a many-to-many relationship. The manifest must cover the junction object and both relationship fields, plus the participating objects when they are not already present. Roll-up summary fields belong to the master object and should be included with the relationship changes that make them possible.

External relationships add further rules. **ExternalLookup** and **IndirectLookup** fields depend on external IDs or matching keys. Include the referenced external object metadata and confirm that the target org has the same field definitions. A relationship can deploy successfully yet fail at runtime if the external key or matching behavior differs.

Object-level settings may be lost when a release selects only individual fields. These settings can include sharing model, deployment status, search settings, plural labels, and optional features such as activities or reports. When those properties change, include the parent custom object definition, not just the changed child field.

Managed package behavior can affect custom object names. A namespaced object and a local object with a similar label are different metadata members. Preserve the namespace where the platform requires it, and do not infer identity from the label shown to users.

Before deploying an object model, check the dependency chain:

  - Referenced parent objects exist in the target org.

  - Relationship fields use the same API names and relationship types.

  - External IDs and unique-key settings match the integration design.

  - Roll-up summaries follow their master-detail relationships.

  - Formula fields reference fields available in the target metadata.

  - Required object features, such as activities or history tracking, are enabled where needed.

Salesforce represents many object children in the retrieved custom object metadata, even when the project structure separates them into individual files. The source format may look modular, while the Metadata API still evaluates the object model as a connected structure.

For complex schema changes, use a validation deployment before the actual release. A validation can reveal relationship order, unsupported field settings, and missing dependencies without changing the target org. This is especially valuable for master-detail conversions, junction objects, and fields referenced by formulas or automation.

Refer to the [CustomObject Metadata API reference](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_customobject.htm) for the supported child properties and relationship-specific rules.

## Apex, Lightning Web Components, and Aura Bundles
**Apex, Lightning Web Components, and Aura bundles use different metadata boundaries.** Apex is selected by individual class, trigger, interface, or test class. A Lightning web component and an Aura component are selected as complete bundles. Package.xml should therefore match the unit Salesforce compiles and deploys, not the number of files visible in the project.

For Apex, the main metadata types are **ApexClass**, **ApexTrigger**, and **ApexTestSuite**. An Apex class member is the class API name. A trigger member is the trigger name. Test classes use **ApexClass**; Salesforce does not provide a separate metadata type just because a class contains tests.

Typical Apex entries look like this:

*OrderService* — **ApexClass**

*OrderServiceTest* — **ApexClass**

*OrderTrigger* — **ApexTrigger**

Deploy production Apex with tests that cover the changed behavior. The manifest selects the code and test classes, but test execution is controlled by the deployment command and its test-level settings. A package.xml file cannot force a specific test strategy by itself.

Apex dependencies are easy to miss. A class may reference custom metadata types, labels, queues, platform events, or another Apex class. Static resources can also be loaded by Visualforce or Apex. Include those dependencies when the target org does not already contain them; otherwise, compilation can fail even though the changed class is present.

Lightning web components use **LightningComponentBundle**. The member is the bundle directory name, such as *orderSummary*. Do not list its HTML, JavaScript, CSS, XML, or test files separately. All files in that bundle travel together.

A bundle’s configuration file controls important behavior, including exposed targets, object availability, form factors, and API version. If a component is intended for App Builder, record pages, or utility items, include the configuration file in the source package and review its target settings with the component change.

Lightning web component tests use JavaScript files in the project, but they are not selected through a separate Salesforce metadata member. They are executed by the local JavaScript test setup rather than by Apex deployment tests. Keep this distinction clear when a feature has both client-side and server-side test coverage.

Aura uses **AuraDefinitionBundle**. The member is the bundle name, for example *orderConsole*. Controller, helper, renderer, design, SVG, and component files belong to that bundle and should not be listed as independent members.

Aura bundles can depend on Apex controllers, interfaces, custom labels, and static resources. Deploy the server-side types and referenced assets with the bundle when they are new or changed. A component may compile in the source org simply because an old dependency already exists there; the target org may not have that same foundation.

Use this dependency check before packaging a front-end change:

  - Include the complete LWC or Aura bundle.

  - Check Apex controllers, services, and test classes used by the UI.

  - Check labels, static resources, permissions, and object access required at runtime.

  - Review LWC target configuration or Aura design attributes.

  - Confirm that renamed bundles are handled as a removal plus an addition where required.

Salesforce may compile metadata in an order that differs from the order of entries in package.xml. Do not try to control compilation order by rearranging XML blocks. Resolve the real dependency instead: include the missing type, correct its API name, or split the release when a platform constraint requires separate stages.

For current support details, consult the [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) and the relevant Apex, LWC, or Aura metadata reference. These resources show whether a component supports retrieval, deployment, or only limited operations in a given API version.

## Flows, Permissions, Profiles, and Permission Sets
**Flows, profiles, and permission sets have different deployment behavior.** A manifest can select their metadata definitions, but it does not reproduce every runtime assignment or activation state. Treat each security or automation layer as a separate release concern.

Use the **Flow** metadata type for flow definitions. A flow can contain several versions, but only one version is normally active in an org. Deploying a changed flow does not automatically mean that the intended version is active in the target. Confirm the activation step after deployment, especially when an existing process depends on the flow’s current version.

Flow metadata can also include references to objects, fields, Apex actions, email alerts, subflows, custom permissions, and decision logic. A flow may deploy while still behaving differently if its referenced configuration is missing or has different values. Map these dependencies before creating a release manifest.

Permission metadata describes access; it does not grant access simply because the file is deployed. A permission set must be assigned to users, groups, or other supported principals through a separate operational step. The same distinction applies to permission set groups. Include the group definition and its component permission sets, then handle assignments and recalculation as part of the release plan.

Permission set groups can include muting permission sets. A muting permission set removes selected permissions from the effective group access. If a group behaves differently in the target org, check all three layers: the group, its included permission sets, and its muting configuration.

Profiles are broader and more sensitive than permission sets. A profile can contain object permissions, field-level security, user permissions, Apex class access, Visualforce page access, tab visibility, record type settings, and other user configuration. Changes to a profile can therefore affect users who were not part of the original feature request.

For that reason, use profiles carefully in a narrowly scoped deployment. If a new feature needs additional access, a permission set is often easier to review and less likely to alter unrelated user behavior. This is a design choice, not a package.xml rule, but it has a major effect on release risk.

Profiles also depend on the metadata they reference. A profile entry can contain access to an Apex class, field, object, flow, or page that is absent from the target org. Deploy the referenced component first or include it in the same validated release when the platform permits it.

Keep these items distinct:

  - **Definition:** the flow, profile, permission set, or group metadata.

  - **Assignment:** which users or groups receive a permission set.

  - **Activation:** which flow version is active.

  - **Effective access:** the final result after profiles, permission sets, groups, and muting rules combine.

Flows can also be invoked by record changes, schedules, platform events, buttons, actions, or orchestration steps. The manifest entry does not prove that the invocation path exists. Check the calling automation and any entry conditions when a flow is moved between orgs.

Use least privilege when designing new access. Start with the smallest permission set that supports the feature, then add access only when a real business action requires it. This produces a clearer audit trail than expanding a large profile for every change.

Salesforce’s [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) lists support and limits for automation and security types. For assignments and post-deployment access checks, also use the org’s deployment records and permission-assignment process rather than assuming that a successful metadata deployment equals usable access.

## Reports, Dashboards, Email Templates, and Documents
**Reports, dashboards, email templates, and documents use folder-aware metadata.** Their package.xml members often represent both the asset and its folder location. This matters because the visible asset name alone may not identify a unique component.

A report member commonly follows this pattern:

*Finance/Outstanding Invoices* — **Report**

The folder appears before the slash, followed by the report name. A dashboard uses the same general path style:

*Executive/Revenue Summary* — **Dashboard**

Folder names and asset names are case-sensitive in practice. Spaces are part of the member value, so do not replace them with underscores or URL encoding. A report called “Open Cases” is not the same member as “Open_Cases.”

Folder access can affect retrieval and deployment. A user may see a report in Salesforce but lack the permissions needed to retrieve or deploy its folder. Private, public, and shared folders can also behave differently across orgs. Check folder visibility and sharing separately from the report or dashboard definition.

Dashboards often depend on source reports. Include those reports when the target org does not already contain matching versions. A dashboard can deploy as metadata while displaying incomplete or incorrect results if its source reports, filters, or folder paths differ.

Reports may reference custom report types, objects, fields, and bucket fields. A deployment can fail when a report filter uses a field that is missing in the target. Before packaging a report, compare its selected columns, filters, groupings, and report type with the target data model.

Email templates are folder-based assets in many Salesforce project formats. A typical member may look like this:

*Service/Case Follow-Up* — **EmailTemplate**

Templates can contain merge fields, letterhead references, folders, and attachments or images. Verify that every merge field exists in the target object model. A template may deploy successfully but produce poor output if a referenced field is unavailable, blank, or renamed.

Lightning email templates can use enhanced folder management and may include related assets that older template formats do not. Check the template format before selecting a member. Classic and Lightning email assets are not interchangeable merely because users see them in the same email-template area.

Documents are represented by the **Document** metadata type where supported. A document member commonly includes its folder and file name:

*Branding/Invoice Logo* — **Document**

Documents are legacy content assets in many orgs. They are not the same as Salesforce Files, CRM Content, or static resources. If a Visualforce page, email template, or other component references a document, preserve the expected folder and file identity. Moving the file can break that reference.

Use this focused check before adding these assets to a release:

  - Confirm the exact folder and asset path.

  - Check whether the target folder exists and is accessible.

  - Include source reports required by dashboards.

  - Verify report types, fields, filters, and groupings.

  - Test email merge fields and letterhead references.

  - Distinguish Documents from Files, Content assets, and static resources.

Salesforce’s [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) identifies support limits for report, dashboard, template, and document metadata. Check it when an asset retrieves successfully but cannot be deployed, or when a folder-based member behaves differently between API versions.

## Experience Cloud, Digital Experiences, and External Components
**Experience Cloud metadata is broader than the visible site.** A digital experience can include the site container, branding, navigation, pages, audiences, CMS content, moderation settings, and guest-user access. A package.xml manifest must reflect the parts that make the experience function, not only its public URL.

Common metadata types include **Network** for the Experience Cloud site, **ExperienceBundle** for site configuration, and **DigitalExperienceBundle** for newer digital experience structures. The exact type depends on the site framework and API support. Do not mix entries from different site models without checking the retrieved source format.

An ExperienceBundle usually stores site elements as structured files. These can cover routes, views, branding, theme settings, navigation menus, and audience targeting. The manifest selects the bundle, while the project files hold the detailed configuration. A missing route or theme file may not cause an XML error, yet the deployed site can still render incorrectly.

Experience Cloud sites also rely on objects, fields, Apex controllers, Lightning components, flows, CMS collections, and permissions. Guest users are especially important. Their profile and site permissions determine which pages, records, files, and services an unauthenticated visitor can access.

Review external access separately from internal access. A component may work for an administrator but fail for a guest user because of sharing rules, guest-user restrictions, Apex access, or field-level security. Package.xml selects the metadata; it does not prove that the public access model is safe or complete.

External components can include named credentials, external credentials, authentication providers, external data sources, and external services. These types often connect Salesforce to systems outside the org. Secrets and environment-specific values should not be copied blindly between environments. The metadata definition may deploy while the endpoint, certificate, permission set, or authentication configuration still needs controlled setup.

External data sources also require attention to identity and endpoint behavior. A connection can use a different URL, tenant, certificate, or principal in a test org than in production. Keep environment-specific values outside a shared manifest where possible, and map them during deployment through the approved configuration process.

For an Experience Cloud release, check these layers:

  - **Site layer:** network or digital experience definition.

  - **Presentation layer:** themes, branding, routes, pages, and components.

  - **Content layer:** CMS content, collections, and translations.

  - **Access layer:** guest profile, sharing rules, permissions, and login settings.

  - **Integration layer:** named credentials, external services, certificates, and data sources.

Site URLs and domains deserve a separate check. A deployment can transfer site configuration without making the final domain available immediately. Domain activation, HTTPS settings, login flows, and redirects may require org-level actions that package.xml cannot perform.

Use a non-production site to test navigation, audience visibility, guest access, login, CMS rendering, and external calls. Test both an authenticated user and an anonymous browser session. Experience Cloud defects often appear only at the boundary between metadata and runtime access.

The [Salesforce Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) provides current support details for Experience Cloud and external integration types. Consult it before choosing between **Network**, **ExperienceBundle**, and **DigitalExperienceBundle**, since support varies by feature and API version.

## Namespaces, Managed Packages, and Special Metadata Cases
**Namespaces change component identity.** In a Salesforce package, the namespace prefix separates packaged components from local components. A class such as *acme__BillingService* is not the same metadata member as *BillingService*, even when both names look similar in Setup.

Use the namespace required by the metadata type and the org context. Packaged custom objects, fields, tabs, labels, and custom permissions often carry a prefix in their API names. References inside formulas, Apex, flows, and Lightning components may use a related namespace syntax, but the manifest member must follow the Metadata API format for that component.

Managed package metadata is also subject to package ownership. A subscriber org can use many packaged components, but it cannot freely modify protected or package-controlled definitions. A deployment that attempts to overwrite such metadata may fail, even when the member name is correct.

Do not add installed managed-package components to a release manifest merely because they appear in a retrieved org. First decide whether the component belongs to the package, the subscriber customization, or a dependency. Retrieving everything can blur that boundary and create a manifest that tries to redeploy metadata the target org already receives through package installation.

Unlocked packages have a different lifecycle. Their components are versioned and installed as package versions, while ordinary metadata deployment remains useful for org configuration outside the package. Keep package-owned source separate from subscriber-specific settings. Otherwise, the same component may be managed by two release paths, which is a recipe for conflicts.

Some metadata types need special handling because their names are not simple component names:

  - **Translations:** one member can represent language-specific translations across several metadata areas.

  - **Custom labels:** label definitions and translated values may travel through different metadata structures.

  - **Standard value sets:** picklist values may belong to a global value set rather than one object field.

  - **Duplicate rules and matching rules:** names can be linked to an object and may depend on matching configuration.

  - **Settings metadata:** org-wide settings often use fixed member names instead of user-created API names.

  - **Certificate and credential metadata:** definitions may be deployable, while secrets or private keys are intentionally excluded.

Protected package components create another boundary. A protected custom metadata record, label, or resource may be available to package code but hidden from subscriber editing. Package.xml cannot bypass that protection. If a deployment requires a protected value, update the package version or use the supported extension mechanism instead.

Namespace changes are rarely cosmetic. Renaming a namespace, moving a component into a package, or removing a package dependency can alter references across Apex, formulas, flows, permissions, and integrations. Plan these changes as migrations, not as ordinary manifest edits.

Before deploying across package boundaries, verify:

  - Which namespace owns each selected component.

  - Whether the target org has the required package version installed.

  - Whether the metadata is editable, protected, or package-controlled.

  - Whether an unlocked package or ordinary metadata deployment owns the change.

  - Whether namespace-qualified references remain valid after installation.

The [Metadata Coverage report](https://developer.salesforce.com/docs/metadata-coverage) and the [second-generation packaging documentation](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/) describe current support and package lifecycle rules. Check both when a component crosses from local metadata into a managed or unlocked package.

## Validation, Deployment, Retrieval, and Troubleshooting
**Validation, retrieval, and deployment are separate Metadata API operations.** A package.xml file can be valid XML and still fail because of missing dependencies, unsupported members, access limits, or target-org rules. Test each operation with the result you actually need.

Use **retrieve** to copy metadata from an org into a project. Retrieval is useful for discovering the exact source representation and creating a baseline. It can also return more related metadata than expected, so inspect the result before treating it as a release-ready package.

Use **validate** to run deployment checks without applying the changes. Validation is valuable for finding component errors, dependency gaps, duplicate names, and target-org conflicts before a release window. A successful validation is not permanent; the target org can change before deployment, and a validation result may expire under the deployment process.

Use **deploy** to apply the selected metadata. Deployment results include component-level status, errors, warnings, test details, and an overall result. Read the component messages, not only the final success or failure label. One warning can signal a behavior change even when the deployment completes.

For command-line workflows, capture the operation ID and result in the release record. This creates a useful audit trail: the manifest, API version, target org, test settings, start time, and final result can be linked to one deployment attempt.

Common failure messages usually point to different classes of problems:

  - **Component not found:** the member name, namespace, folder path, or metadata type is wrong, or the user cannot access it.

  - **Not available for deployment:** the type has limited support, or the selected API version does not support the operation.

  - **Duplicate value:** the target already contains a conflicting name, record, rule, or setting.

  - **Missing dependency:** a referenced object, field, class, permission, or configuration item is absent.

  - **Insufficient access:** the deployment user lacks metadata permissions or access to the selected source assets.

  - **Invalid cross reference:** a component points to an identifier that differs between source and target orgs.

When a large deployment fails, reduce the manifest to a small reproducible case. Start with the failing component and its nearest dependency. This separates a naming problem from an ordering constraint or an unrelated error elsewhere in the release. Keep the reduced manifest as a troubleshooting artifact, not as the final production manifest.

Retrieval errors need a different approach. Check whether the source org contains the component, whether the retrieval user can read it, and whether the metadata type supports retrieval. A component visible in Setup is not automatically retrievable through the Metadata API.

Deployment errors can also come from org state. Compare enabled features, licenses, package versions, user permissions, and organization settings between source and target. Two orgs can have identical metadata files but different platform capabilities.

After deployment, run a targeted smoke test. Check the behavior changed by the release, plus one dependent path. For example, test a flow invocation, a page load, a permission boundary, or a report result rather than relying on the deployment status alone.

For authoritative operation details, use the [Metadata API deployment documentation](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm) and the [retrieval documentation](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_retrieve.htm). Error text is often the fastest clue, but the metadata type reference determines the correct remedy.

## Conclusion: Build, Check, and Maintain Reliable Package.xml Files
A reliable **package.xml** file is more than a list of metadata names. It is a precise record of release intent. Build it around a clear change boundary, keep that boundary visible in version control, and update it when the feature’s ownership or structure changes.

Use a simple maintenance routine:

  - Record the purpose of each manifest.

  - Keep naming and formatting consistent across the project.

  - Review additions and removals as part of every code change.

  - Remove obsolete manifests instead of letting them become misleading.

  - Keep the selected API version aligned with the project’s supported release policy.

Treat package.xml as a contract between the source project and the target org. The contract should be narrow enough to prevent accidental changes, yet complete enough to deliver a usable feature. That balance is the real skill: a tiny manifest can be incomplete, while a huge manifest can hide risk.

For long-lived projects, add a short change note when a manifest expands, contracts, or changes purpose. Future maintainers then know whether a new member was required by a dependency, added for a migration, or included by mistake. This small habit saves time during audits and release reviews.

Finally, measure quality by outcomes rather than file size. A dependable manifest identifies the right components, supports repeatable releases, and remains understandable months later. When every entry has a reason and every reason can be checked, package.xml stops being deployment paperwork and becomes a practical control for Salesforce change management.

---

*Dieser Artikel wurde ursprünglich veröffentlicht auf [packagingdiscussions.com](https://packagingdiscussions.com/a-guide-to-packagexml-for-all-components-in-salesforce/)*
*© 2026 Provimedia GmbH*
