How to use the Package.xml Builder
- Start from a preset, or search the list and select the metadata types you need.
- For each type, turn on the wildcard to include every component, or add member names one by one. You can paste a comma-separated list.
- Set the API version to one your org supports.
- Copy the XML or download it as
package.xml, then use it with the Salesforce CLI, VS Code or a deployment tool.
What package.xml is for
A package.xml manifest lists metadata components by type and name. The Metadata API uses it in two directions: to decide what to retrieve from an org, and to describe what a deployment contains. Tools such as the Salesforce CLI, the VS Code extensions, Ant-based scripts and most CI pipelines accept it.
Example
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>Account.Region__c</members>
<members>Invoice__c.Status__c</members>
<name>CustomField</name>
</types>
<version>62.0</version>
</Package>Wildcards: where they work and where they do not
An asterisk as the member means “all components of this type”. It is accepted for types such as ApexClass, ApexTrigger, Flow, LightningComponentBundle, Layout and PermissionSet. It is not accepted for components that live inside an object, such as CustomField, ValidationRule, RecordType and ListView, or for folder-based types such as Report, Dashboard and EmailTemplate. The builder turns the switch off for those types and shows the name format to use instead.
One special case is worth remembering: for CustomObject, the wildcard returns custom objects only. To retrieve a standard object such as Account, add it by name.
Choosing the API version
The <version> element sets the Metadata API version for the operation. Use the version of your project (the sourceApiVersion in sfdx-project.json) or the version your org is currently on. A version newer than the org supports causes the request to fail.
Using the file
# Retrieve the listed components into your project
sf project retrieve start --manifest package.xml
# Deploy the listed components from your project
sf project deploy start --manifest package.xmlCommon mistakes
- Using a label instead of an API name:
Invoiceinstead ofInvoice__c. - Leaving out the object for child components:
Region__cinstead ofAccount.Region__c. - Retrieving a profile alone. Profiles only include permissions for other components in the same manifest.
- Expecting the
CustomObjectwildcard to include standard objects.
Features and limitations
What it does
- Searchable catalogue of commonly deployed metadata types, with the 13 most-used types listed first.
- Wildcard switch per type, disabled where the Metadata API does not accept
*. - Hints for member formats, such as
Object.Fieldfor custom fields andFolder/Namefor reports. - Any other metadata type can be added by typing its name.
- Types and members are sorted and de-duplicated; special characters are XML-escaped.
- Presets for Apex code, Lightning UI, automation, security and the data model.
What it does not do
- The catalogue is a curated subset, not the complete list of metadata types. Salesforce adds types in most releases.
- It does not connect to your org, so it cannot list your components or confirm that a member exists.
- It builds
package.xmlonly. It does not createdestructiveChanges.xmlor the folder of metadata files. - Wildcard support is recorded per type from Salesforce documentation and may change between API versions.