func (stls *TlsStartTLS) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	stls.XMLName = start.Name
	for {
		t, err := d.Token()
		if err != nil {
			return err
		}
		switch tt := t.(type) {
		case xml.StartElement:
			elt := new(Node)
			err = d.DecodeElement(elt, &tt)
			if err != nil {
				return err
			}
			if elt.XMLName.Local == "required" {
				stls.Required = true
			}
		case xml.EndElement:
			if tt == start.End() {
				return nil
			}
		}
	}
}
UnmarshalXML implements custom parsing startTLS required flag
package stanza
import (
	"encoding/xml"
)
type StreamFeatures struct {
	XMLName xml.Name `xml:"http://etherx.jabber.org/streams features"`
	Caps Caps
	StartTLS         TlsStartTLS
	Mechanisms       saslMechanisms
	Bind             Bind
	StreamManagement streamManagement
	Session StreamSession
	P1Push   p1Push
	P1Rebind p1Rebind
	p1Ack    p1Ack
	Any      []xml.Name `xml:",any"`
}
func (StreamFeatures) Name() string {
	return "stream:features"
}
type streamFeatureDecoder struct{}
var streamFeatures streamFeatureDecoder
func (streamFeatureDecoder) decode(p *xml.Decoder, se xml.StartElement) (StreamFeatures, error) {
	var packet StreamFeatures
	err := p.DecodeElement(&packet, &se)
	return packet, err
}
type Caps struct {
	XMLName xml.Name `xml:"http://jabber.org/protocol/caps c"`
	Hash    string   `xml:"hash,attr"`
	Node    string   `xml:"node,attr"`
	Ver     string   `xml:"ver,attr"`
	Ext     string   `xml:"ext,attr,omitempty"`
}
type TlsStartTLS struct {
	XMLName  xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-tls starttls"`
	Required bool
}