xmlwriter xmlwriter是一个纯Go语言库,提供基于libxml2的xmlwriter模块的过程XML生成API。 该软件包已在上广泛记录。 快速示例: func main () { b := & bytes. Buffer {} w := xmlwriter . Open ( b ) ec := & xmlwriter. ErrCollector {} defer ec . Panic () ec . Do ( w. StartDoc (xmlwriter. Doc {}) w . StartElem