Working with XML

Let’s learn how to use records in Go to work with XML data.

How to work with XML data

This lesson briefly describes how to work with XML data in Go using records. The idea behind XML and Go is the same as with JSON and Go. We put tags in Go structures in order to specify the XML tags, and we can still serialize and deserialize XML records using xml.Unmarshal() and xml.Marshal(), which are found in the encoding/xml package.

Coding example

However, there exist some differences that are illustrated in xml.go:

Get hands-on with 1200+ tech skills courses.