ArcGIS Pro 2.7 API Reference Guide
FromXML Method (GeometryBagBuilder)
Example 

ArcGIS.Core.Geometry Namespace > GeometryBagBuilder Class : FromXML Method
XML string representation of GeometryBag.
Creates a new instance of a GeometryBag class from an XML string representation.
Syntax
public static GeometryBag FromXML( 
   string XMLString
)
Public Shared Function FromXML( _
   ByVal XMLString As String _
) As GeometryBag

Parameters

XMLString
XML string representation of GeometryBag.

Return Value

Exceptions
ExceptionDescription
The XMLString is empty or null.
XML is invalid or does not represent a GeometryBag string.
Example
const string jsonString = "{\"geometries\":[{\"x\":1,\"y\":2},{\"rings\":[[[0,0],[0,4],[3,4],[3,0],[0,0]]]}],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}";
GeometryBag geometryBag = GeometryBagBuilder.FromJson(jsonString);

string xml = geometryBag.ToXML();
GeometryBag xmlString = GeometryBagBuilder.FromXML(xml);
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

GeometryBagBuilder Class
GeometryBagBuilder Members