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

In This Topic
    GetXml Method (IMetadata)
    In This Topic
    Gets the item’s metadata XML document as a string.
    Syntax
    Function GetXml() As String
    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;
      // Note: Needs QueuedTask to run
      gdbXMLMetadataXmlAsString = gdbMetadataItem.GetXml();
      //check metadata was returned
      if (!string.IsNullOrEmpty(gdbXMLMetadataXmlAsString))
      {
        //use the metadata
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also