Returns the XML representation of an ST_Geometry value.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsXML()
If the st_geometry_asxml_format option has its default value of 'GML', then the following returns the result <Point srsName="EPSG:4326"><pos>1 2 3 4</pos></Point>.
SELECT CAST( NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ) AS XML)
The following example returns the result <Point srsName="EPSG:4326"><coordinates>1,2</coordinates></Point>.
SELECT NEW ST_Point( 1.0, 2.0, 3.0, 4.0, 4326 ).ST_AsXML('GML(Version=2)')
The following returns a complete SVG document with polygons filled with random colors.
SELECT NEW ST_Polygon( 'Polygon(( 0 0, 0 20, 60 10, 0 0 ))' ) .ST_AsXML( 'SVG' )
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension