ArcGIS Pro 2.6 API Reference Guide
FromXML Method (SpatialReferenceBuilder)
Example 

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

Parameters

XMLString
XML string representation of a SpatialReference.

Return Value

Exceptions
ExceptionDescription
The XMLString is empty or null.
XML is invalid or does not represent a spatial reference string.
Example
SpatialReference srWithVertical = SpatialReferenceBuilder.CreateSpatialReference(4326, 6916);

string xml = srWithVertical.ToXML();
SpatialReference importedSR = SpatialReferenceBuilder.FromXML(xml);
// importedSR.Wkid = 4326
// importedSR.VcsWkid = 6916

string json = srWithVertical.ToJson();
importedSR = SpatialReferenceBuilder.FromJson(json);
// importedSR.Wkid = 4326
// importedSR.VcsWkid = 6916
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 7

See Also

Reference

SpatialReferenceBuilder Class
SpatialReferenceBuilder Members