func (p *Decoder) unmarshalTextInterface(val textUnmarshaler, start *StartElement) error {
	var buf []byte
	depth := 1
	for depth > 0 {
		t, err := p.Token()
		if err != nil {
			return err
		}
		switch t := t.(type) {
		case CharData:
			if depth == 1 {
				buf = append(buf, t...)
			}
		case StartElement:
			depth++
		case EndElement:
			depth--
		}
	}
	return val.UnmarshalText(buf)
}
unmarshalTextInterface unmarshals a single XML element into val.
The chardata contained in the element (but not its children)
is passed to the text unmarshaler.
package xml
import (
	"bytes"
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"strings"
)
type textUnmarshaler interface {
        UnmarshalText(text []byte) error
}
func Unmarshal(data []byte, v interface{}) error {
	return NewDecoder(bytes.NewReader(data)).Decode(v)
}
func (d *Decoder) Decode(v interface{}) error {
	return d.DecodeElement(v, nil)
}
func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error {
	val := reflect.ValueOf(v)
	if val.Kind() != reflect.Ptr {
		return errors.New("non-pointer passed to Unmarshal")
	}
	return d.unmarshal(val.Elem(), start)
}
type UnmarshalError string
func (e UnmarshalError) Error() string { return string(e) }
type Unmarshaler interface {
	UnmarshalXML(d *Decoder, start StartElement) error
}
type UnmarshalerAttr interface {
	UnmarshalXMLAttr(attr Attr) error
}
func receiverType(val interface{}) string {
	t := reflect.TypeOf(val)
	if t.Name() != "" {
		return t.String()
	}
	return "(" + t.String() + ")"
}
func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error {
	p.pushEOF()
	p.unmarshalDepth++
	err := val.UnmarshalXML(p, *start)
	p.unmarshalDepth--
	if err != nil {
		p.popEOF()
		return err
	}
	if !p.popEOF() {
		return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local)
	}
	return nil
}