code: func truncateSheetXML(r io.Reader, rowLimit int) (io.Reader, error) {
  	var rowCount int
  	var token xml.Token
  	var readErr error
  
  	output := new(bytes.Buffer)
  	r = io.TeeReader(r, output)
  	decoder := xml.NewDecoder(r)
  
  	for {
  		token, readErr = decoder.Token()
  		if readErr == io.EOF {
  			break
  		} else if readErr != nil {
  			return nil, readErr
  		}
  		end, ok := token.(xml.EndElement)
  		if ok && end.Name.Local == "row" {
  			rowCount++
  			if rowCount >= rowLimit {
  				break
  			}
  		}
  	}
  
  	offset := decoder.InputOffset()
  	output.Truncate(int(offset))
  
  	if readErr != io.EOF {
  		_, err := output.Write([]byte(sheetEnding))
  		if err != nil {
  			return nil, err
  		}
  	}
  	return output, nil
  }
docs: // truncateSheetXML will take in a reader to an XML sheet file and will return a reader that will read an equivalent
  // XML sheet file with only the number of rows specified. This greatly speeds up XML unmarshalling when only
  // a few rows need to be read from a large sheet.
  // When sheets are truncated, all formatting present after the sheetData tag will be lost, but all of this formatting
  // is related to printing and visibility, and is out of scope for most purposes of this library.