diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index b8dad494fb3..86d1422a5bd 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -945,7 +945,7 @@ func (s *parentStack) trim(parents []string) error { return err } } - s.stack = parents[:split] + s.stack = s.stack[:split] return nil }