The name for the XML elements is taken from, in order of preference: the tag on the XMLName field, if the data is a struct the value of the XMLName field of type Name the tag of the struct field used to obtain the data the name of the struct field used to obtain the data the name of the marshaled type The XML element for a struct contains marshaled elements for each of the exported fields of the struct, with these exceptions: the XMLName field, described above, is omitted. a field with tag "-" is omitted. a field with tag "name,attr" becomes an attribute with the given name in the XML element. a field with tag ",attr" becomes an attribute with the field name in the XML element. a field with tag ",chardata" is written as character data, not as an XML element. a field with tag ",cdata" is written as character data wrapped in one or more <![CDATA[ ... ]]> tags, not as an XML element. a field with tag ",innerxml" is writte