ArcGIS Pro 2.7 API Reference Guide
ExportMetadata(String,MDImportExportOption,MDExportRemovalOption) Method
Example 

ArcGIS.Desktop.Core Namespace > Item Class > ExportMetadata Method : ExportMetadata(String,MDImportExportOption,MDExportRemovalOption) Method
Export metadata. This method must be called on the MCT. Use QueuedTask.Run.
Syntax

Parameters

outputFilePath
exportType
removalOption
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
await QueuedTask.Run(() => metadataItemExport1.ExportMetadata(@"E:\Temp\OutputXML.xml",  MDImportExportOption.esriCurrentMetadataStyle, MDExportRemovalOption.esriExportExactCopy));
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Item Class
Item Members
Overload List