Merge, compare and view package.xml files

Winter '27 API 68.0 Checked against the official docs on Source: Metadata API Developer Guide: Sample package.xml Manifest Files

Quick answer

Paste one package.xml to view it as a type tree, two to see what was added or removed between them, or two to merge them into one sorted, de-duplicated manifest. It runs in your browser and nothing is uploaded.

Compare or merge manifests

The tool needs JavaScript. The explanation and worked examples below work without it.

Paste a package.xml into box A, and into box B to compare or merge.

When you need to merge or compare manifests

A package.xml says which components a retrieve or deploy touches. Teams end up with several of them: one per feature branch, one per release, one generated by sf project generate manifest and one written by hand. Three jobs come up again and again.

  • Combining manifests. Two features shipped together need one deploy. Merging gives one file with the union of both, with no duplicate members.
  • Reviewing a change. A pull request edits the manifest and the diff is hard to read because the order moved. Comparing the two files shows only what was really added or removed.
  • Cleaning up. A hand-edited file has duplicate members, empty types and mixed ordering. One pass through the merge produces a sorted, de-duplicated file.

The tool reads the types, members, name and version elements, ignores comments and whitespace, and decodes XML entities such as &. If a file is not a manifest, or a type has no name, it tells you instead of failing silently.

How merging treats the wildcard

A member of * asks for all components of a type. When any input has * for a type, the merged type is just *, since the wildcard already includes every named member. The compare view flags the case where one side uses * and the other names members, because the two files then ask for different things even if the named members are a subset. Not every metadata type supports the wildcard, so read the type's page in the Metadata API Developer Guide before deploying with it.

Common mistakes

  • Merging manifests built for different API versions and not checking the result. The merged file takes the highest version; confirm your org supports it.
  • Treating a clean diff as proof that a deploy is safe. A manifest names components; it does not check dependencies or test coverage.
  • Expecting the tool to read your org. It only works with the text you paste. Use sf project retrieve start --manifest package.xml to act on a manifest.

Worked example: compare

Manifest A lists two Apex classes and a flow at API 67.0. Manifest B lists a different pair of Apex classes and a custom field at API 68.0. This report was produced at build time by the same code the tool runs. + was added, - was removed and ~ changed.

Version: 67.0 -> 68.0
+ CustomField: Account.Region__c
- Flow: Lead_Assignment
~ ApexClass
    + ContactService
    - AccountServiceTest

Worked example: merge

Merging the same two manifests keeps every member once, sorts them and uses the higher version.

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

To create a manifest from scratch, use the package.xml generator. For the retrieve and deploy commands that use the result, see the Salesforce CLI reference guide.

Frequently asked questions

How do I merge two package.xml files?

Paste both manifests into the boxes above and choose Merge. The tool takes the union of members for each metadata type, removes duplicates, sorts types and members, and writes one package.xml. It uses the highest API version found in the two files.

How do I compare two package.xml files?

Paste the older manifest into box A and the newer one into box B, then choose Compare. The result lists types that were added or removed and, for types present in both, the members that were added or removed. Choose Copy result to paste the report into a pull request.

What happens to the * wildcard when manifests are merged?

If any input lists * for a type, the merged type is just *, because the wildcard already covers every named member. Not every metadata type supports the wildcard, so check the type in the Metadata API Developer Guide before deploying with it.

Does the order of types and members in a package.xml matter?

No. Metadata API treats the order as irrelevant. Sorting is a convention that keeps diffs and merges stable, which is why the merged output is sorted.

Which API version does the merged file use?

The highest valid version element found in the pasted manifests. If none of them has a valid version, the tool uses 68.0, the API version of Winter '27. Check the version before you deploy.

Can I clean up a single package.xml?

Yes. Paste one manifest into box A and choose Merge. The tool sorts it, removes duplicate members and drops empty types, and writes the cleaned file.

Does my package.xml leave my browser?

No. Parsing, comparing and merging all run in your browser and nothing you paste is uploaded. A manifest lists component names only, but remove any names you would not share before posting a diff publicly.

More tools

SFDX Talk is unofficial documentation. It is not affiliated with, endorsed by, or sponsored by Salesforce, Inc. Salesforce changes its platform every release, so confirm against the official page before relying on a value.