func (iq *IQ) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
	iq.XMLName = start.Name
	for _, attr := range start.Attr {
		if attr.Name.Local == "id" {
			iq.Id = attr.Value
		}
		if attr.Name.Local == "type" {
			iq.Type = StanzaType(attr.Value)
		}
		if attr.Name.Local == "to" {
			iq.To = attr.Value
		}
		if attr.Name.Local == "from" {
			iq.From = attr.Value
		}
	}
	for {
		t, err := d.Token()
		if err != nil {
			return err
		}
		switch tt := t.(type) {
		case xml.StartElement:
			if tt.Name.Local == "error" {
				var xmppError Err
				err = d.DecodeElement(&xmppError, &tt)
				if err != nil {
					return err
				}
				iq.Error = &xmppError
				continue
			}
			if iqExt := TypeRegistry.GetIQExtension(tt.Name); iqExt != nil {
				err = d.DecodeElement(iqExt, &tt)
				if err != nil {
					return err
				}
				iq.Payload = iqExt
				continue
			}
			node := new(Node)
			err = d.DecodeElement(node, &tt)
			if err != nil {
				return err
			}
			iq.Any = node
		case xml.EndElement:
			if tt == start.End() {
				return nil
			}
		}
	}
}
UnmarshalXML implements custom parsing for IQs
package stanza
import (
	"encoding/xml"
	"errors"
	"strings"
	"github.com/google/uuid"
)
type IQ struct {  
	XMLName xml.Name `xml:"iq"`
	Attrs
	Payload IQPayload `xml:",omitempty"`
	Error   *Err      `xml:"error,omitempty"`
	Any *Node `xml:",any"`
}
type IQPayload interface {
	Namespace() string
	GetSet() *ResultSet
}
func NewIQ(a Attrs) (*IQ, error) {
	if a.Id == "" {
		if id, err := uuid.NewRandom(); err == nil {
			a.Id = id.String()
		}
	}
	iq := IQ{
		XMLName: xml.Name{Local: "iq"},
		Attrs:   a,
	}
	if iq.Type.IsEmpty() {
		return nil, IqTypeUnset
	}
	return &iq, nil
}
func (iq *IQ) MakeError(xerror Err) *IQ {
	from := iq.From
	to := iq.To
	iq.Type = "error"
	iq.From = to
	iq.To = from
	iq.Error = &xerror
	return iq
}
func (*IQ) Name() string {
	return "iq"
}
func (*IQ) NoOp() {
}
type iqDecoder struct{}
var iq iqDecoder
func (iqDecoder) decode(p *xml.Decoder, se xml.StartElement) (*IQ, error) {
	var packet IQ
	err := p.DecodeElement(&packet, &se)
	return &packet, err
}