code: func UnmarshalBody(typeFunc func(string) (reflect.Type, bool), data []byte) (*Method, error) {
  	body := &Element{typeFunc: typeFunc}
  	req := soap.Envelope{
  		Header: &soap.Header{
  			Security: new(Element),
  		},
  		Body: body,
  	}
  
  	err := xml.Unmarshal(data, &req)
  	if err != nil {
  		return nil, fmt.Errorf("xml.Unmarshal: %s", err)
  	}
  
  	var start xml.StartElement
  	var ok bool
  	decoder := body.decoder()
  
  	for {
  		tok, derr := decoder.Token()
  		if derr != nil {
  			return nil, fmt.Errorf("decoding: %s", derr)
  		}
  		if start, ok = tok.(xml.StartElement); ok {
  			break
  		}
  	}
  
  	if !ok {
  		return nil, fmt.Errorf("decoding: method token not found")
  	}
  
  	kind := start.Name.Local
  	rtype, ok := typeFunc(kind)
  	if !ok {
  		return nil, fmt.Errorf("no vmomi type defined for '%s'", kind)
  	}
  
  	val := reflect.New(rtype).Interface()
  
  	err = decoder.DecodeElement(val, &start)
  	if err != nil {
  		return nil, fmt.Errorf("decoding %s: %s", kind, err)
  	}
  
  	method := &Method{Name: kind, Header: *req.Header, Body: val}
  
  	field := reflect.ValueOf(val).Elem().FieldByName("This")
  
  	method.This = field.Interface().(types.ManagedObjectReference)
  
  	return method, nil
  }
docs: // UnmarshalBody extracts the Body from a soap.Envelope and unmarshals to the corresponding govmomi type