package xmpp import ( "log" ) type message struct { Type string `xml:"type,attr"` From string `xml:"from,attr"` Body string `xml:"body"` } func handleMessage(s *session, m message) { if m.Type == "chat" { log.Printf("Got message '%s' from '%s'.\n", m.Body, m.From) } }