# package.xml Generator

> A package.xml is the manifest that tells Metadata API which components to retrieve or deploy: a list of metadata types, the members of each, and an API version. Checked against the official docs on 2026-11-17.

Source: [Metadata API Developer Guide: Sample package.xml Manifest Files](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/manifest_samples.htm)
Interactive generator: https://sfdxtalk.com/tools/package-xml-generator/

## Example

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>AccountService</members>
        <members>AccountServiceTest</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>Account.Region__c</members>
        <name>CustomField</name>
    </types>
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>68.0</version>
</Package>
```

Types and members are sorted, `*` means all members of the type (not every type supports it), and `<version>` comes last.

## Commands

```bash
sf project retrieve start --manifest package.xml --target-org <alias-or-username>
sf project deploy start --manifest package.xml --target-org <alias-or-username>
sf project generate manifest --source-dir force-app --name package
```

## Common metadata types

| API name | Metadata |
| --- | --- |
| [`ApexClass`](https://sfdxtalk.com/docs/metadata/apex-class-metadata-type/) | Apex classes |
| [`ApexTrigger`](https://sfdxtalk.com/docs/metadata/apex-trigger-metadata-type/) | Apex triggers |
| [`ApexPage`](https://sfdxtalk.com/docs/metadata/apex-page-metadata-type/) | Visualforce pages |
| [`ApexComponent`](https://sfdxtalk.com/docs/metadata/apex-component-metadata-type/) | Visualforce components |
| [`AuraDefinitionBundle`](https://sfdxtalk.com/docs/metadata/aura-definition-bundle-metadata-type/) | Aura components |
| [`LightningComponentBundle`](https://sfdxtalk.com/docs/metadata/lightning-component-bundle-metadata-type/) | Lightning Web Components |
| [`CustomObject`](https://sfdxtalk.com/docs/metadata/custom-object-metadata-type/) | Custom and standard objects, with their fields and other child components |
| [`CustomField`](https://sfdxtalk.com/docs/metadata/custom-field-metadata-type/) | Individual fields, as Object.Field members |
| [`ValidationRule`](https://sfdxtalk.com/docs/metadata/validation-rule-metadata-type/) | Validation rules, as Object.Rule members |
| [`RecordType`](https://sfdxtalk.com/docs/metadata/record-type-metadata-type/) | Record types, as Object.RecordType members |
| [`Layout`](https://sfdxtalk.com/docs/metadata/layout-metadata-type/) | Page layouts |
| [`FlexiPage`](https://sfdxtalk.com/docs/metadata/flexipage-metadata-type/) | Lightning pages |
| [`CustomTab`](https://sfdxtalk.com/docs/metadata/custom-tab-metadata-type/) | Custom tabs |
| [`CustomApplication`](https://sfdxtalk.com/docs/metadata/custom-application-metadata-type/) | Apps, including Lightning apps |
| [`Flow`](https://sfdxtalk.com/docs/metadata/flow-metadata-type/) | Flows |
| [`PermissionSet`](https://sfdxtalk.com/docs/metadata/permission-set-metadata-type/) | Permission sets |
| [`Profile`](https://sfdxtalk.com/docs/metadata/profile-metadata-type/) | Profiles |
| [`StaticResource`](https://sfdxtalk.com/docs/metadata/static-resource-metadata-type/) | Static resources |
| [`EmailTemplate`](https://sfdxtalk.com/docs/metadata/email-template-metadata-type/) | Email templates (members include the folder name) |
| [`CustomLabels`](https://sfdxtalk.com/docs/metadata/custom-labels-metadata-type/) | Custom labels |
