diff -r a01e06faf0db -r 4dabfef08c8c structs.go --- a/structs.go Sat Dec 24 00:39:18 2011 -0700 +++ b/structs.go Sat Dec 24 09:55:26 2011 -0700 @@ -44,7 +44,7 @@ type StreamError struct { cond definedCondition - text errText + text *errText } var _ xml.Marshaler = &StreamError{} @@ -54,7 +54,6 @@ } type errText struct { - XMLName xml.Name Lang string text string `xml:"chardata"` } @@ -88,7 +87,9 @@ buf := bytes.NewBuffer(nil) buf.WriteString("") xml.Marshal(buf, s.cond) - xml.Marshal(buf, s.text) + if s.text != nil { + xml.Marshal(buf, s.text) + } buf.WriteString("") return buf.Bytes(), nil }