outline-headers-as-kill
outline-headers-as-kill is an interactive compiled Lisp function in `outline.el
'.
(outline-headers-as-kill BEG END)
Save the visible outline headers in region at the start of the kill ring.
Text shown between the headers isn't copied. Two newlines are
inserted between saved headers. Yanking the result may be a
convenient way to make a table of contents of the buffer.