Skip to content

Package.xml Builder

Pick metadata types and members, then copy a ready-to-use package.xml.

Runs in your browser. Nothing is uploaded.

Metadata types

2 selected

Start from a preset

This list covers 42 commonly used types, not the full Metadata API. Add any other type by name.

Match your project or org.

Members for each selected type

  • ApexClass

    Apex classes

  • ApexTrigger

    Apex triggers

package.xml

2 types, 2 members
<?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>*</members>
        <name>ApexTrigger</name>
    </types>
    <version>65.0</version>
</Package>

How to use the Package.xml Builder

  1. Start from a preset, or search the list and select the metadata types you need.
  2. 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.
  3. Set the API version to one your org supports.
  4. 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
<?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

Example
# 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.xml

Common mistakes

  • Using a label instead of an API name: Invoice instead of Invoice__c.
  • Leaving out the object for child components: Region__c instead of Account.Region__c.
  • Retrieving a profile alone. Profiles only include permissions for other components in the same manifest.
  • Expecting the CustomObject wildcard 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.Field for custom fields and Folder/Name for 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.xml only. It does not create destructiveChanges.xml or the folder of metadata files.
  • Wildcard support is recorded per type from Salesforce documentation and may change between API versions.

Questions about the Package.xml Builder

In a Salesforce DX project it usually lives in a manifest folder at the project root. The file can be anywhere, as long as you pass its path to the --manifest flag.

Use the version your project targets or the version of your org. You can see an org’s version in Setup under Apex Classes, where new classes default to the current version, or in the release information for your instance.

The Metadata API does not accept * for those types. Components that belong to an object need Object.Component names, and folder-based components need Folder/Component names.

Yes. Type its exact name in the search box and choose to add it. The Metadata Coverage Report on the Salesforce developer site lists every type.

No. It builds the file from what you select and type. Nothing is sent to Salesforce or to us.

Deletions use a separate file named destructiveChanges.xml with the same structure, deployed together with a package.xml. This builder creates the package.xml part.