package xmpp import ( "encoding/xml" "log" ) func route(s *xml.StartElement, d *xml.Decoder, c chan<- any) { switch (*s).Name { case xml.Name{`http://etherx.jabber.org/streams`, `features`}: data := streamFeatures{} err := d.DecodeElement(&data, s) if err != nil { log.Printf("Could not decode stream features: %v\n", err) } else { log.Print(data) // TODO } default: d.Skip() } }