ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / IMetadata Interface / GetXml Method
Example Version

GetXml Method (IMetadata)
Gets the item’s metadata XML document as a string.
Syntax
string GetXml()

Return Value

Metadata xml string
Remarks
Not all items support metadata. Be sure to check for empty string or null as the return value from GetXml.
Example
Item: Get an item's metadata: GetXML
string gdbXMLMetadataXmlAsString = string.Empty;
gdbXMLMetadataXmlAsString = await QueuedTask.Run(() => gdbMetadataItem.GetXml());
//check metadata was returned
if (!string.IsNullOrEmpty(gdbXMLMetadataXmlAsString))
{
  //use the metadata
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also