code: func (p *printer) marshalInterface(val Marshaler, start StartElement) error {
  	// Push a marker onto the tag stack so that MarshalXML
  	// cannot close the XML tags that it did not open.
  	p.tags = append(p.tags, Name{})
  	n := len(p.tags)
  
  	err := val.MarshalXML(p.encoder, start)
  	if err != nil {
  		return err
  	}
  
  	// Make sure MarshalXML closed all its tags. p.tags[n-1] is the mark.
  	if len(p.tags) > n {
  		return fmt.Errorf("xml: %s.MarshalXML wrote invalid XML: <%s> not closed", receiverType(val), p.tags[len(p.tags)-1].Local)
  	}
  	p.tags = p.tags[:n-1]
  	return nil
  }
docs: // marshalInterface marshals a Marshaler interface value.