package xhtml_test import ( "encoding/xml" "log" "testing" ) func TestMain(t *testing.T) { type Bold struct { XMLName xml.Name `xml:"b"` Content string `xml:",chardata"` } type test struct { XMLName xml.Name `xml:"p"` Content string `xml:",chardata"` Bold []Bold `xml:"b"` } var v test xml.Unmarshal([]byte(`

Hello, world

`), &v) log.Printf("%#v", v) }