Edited Answer
If you want to export the skeleton of your document, without having to extract all sectioning commands, try this way.
Load the tocloft package and, at the end of your document, add the following lines:
\tocloftpagestyle{empty}
\pagestyle{empty}
\renewcommand{\contentsname}{Skeleton}
\renewcommand{\cfttoctitlefont}{\huge\bfseries}
\renewcommand{\cftaftertoctitle}{\vspace*{\baselineskip}}
\setlength{\cftparskip}{\baselineskip}
\cftpagenumbersoff{section}
\cftpagenumbersoff{subsection}
\cftpagenumbersoff{subsubsection}
\renewcommand{\cftsubsecdotsep}{\cftnodots}
\renewcommand{\cftsubsubsecdotsep}{\cftnodots}
\renewcommand{\cftsubsecindent}{0pt}
\renewcommand{\cftsubsubsecindent}{0pt}
\renewcommand{\cftsecfont}{\Large\bfseries}
\renewcommand{\cftsubsecfont}{\large\bfseries}
\renewcommand{\cftsubsubsecfont}{\normalsize\bfseries}
\tableofcontents
In this way, we create a ToC which has the same structure of sectioning titles in the document, but without text.
If you also need a proper ToC in the document, load the shorttoc package and add the following line in your document where you want the ToC:
\shorttoc{Contents}{3}
MWE:
\documentclass{article}
\usepackage{tocloft}
\usepackage{shorttoc}
\usepackage{blindtext}
\begin{document}
\shorttoc{Contents}{3}
\clearpage
\blinddocument
\blinddocument
\blinddocument
\clearpage
\tocloftpagestyle{empty}
\pagestyle{empty}
\renewcommand{\contentsname}{Skeleton}
\renewcommand{\cfttoctitlefont}{\huge\bfseries}
\renewcommand{\cftaftertoctitle}{\vspace*{\baselineskip}}
\setlength{\cftparskip}{\baselineskip}
\cftpagenumbersoff{section}
\cftpagenumbersoff{subsection}
\cftpagenumbersoff{subsubsection}
\renewcommand{\cftsubsecdotsep}{\cftnodots}
\renewcommand{\cftsubsubsecdotsep}{\cftnodots}
\renewcommand{\cftsubsecindent}{0pt}
\renewcommand{\cftsubsubsecindent}{0pt}
\renewcommand{\cftsecfont}{\Large\bfseries}
\renewcommand{\cftsubsecfont}{\large\bfseries}
\renewcommand{\cftsubsubsecfont}{\normalsize\bfseries}
\tableofcontents
\end{document}
Output (proper ToC):

Output (skeleton ToC):

At this point, supposing that your document is called mydoc.tex, to extract the skeleton ToC in a separate pdf file create a new document called skeleton.tex with the following contents:
skeleton.tex
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=11-12]{mydoc.pdf}
\end{document}
The resulting pdf is exactly what you want. Of course you will have to change pages=11-12 to the right range of pages containing the skeleton ToC in your document.
Original Answer
\sections and alike don't allow page breaks after them. So, if you don't have any text following them, you will have them all in one page with an overfull box.
If you only want to see the structure of your document, either use the ToC for that or add the following lines in your preamble:
\usepackage{etoolbox}
\preto{\section}{\leavevmode}
MWE
\documentclass{article}
\usepackage{etoolbox}
\preto{\section}{\leavevmode}
\begin{document}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\section{Foo}
\subsection{bar}
\subsection{bar}
\subsection{bar}
\end{document}
Output

\tableofcontents, most probably, right after\begin{document}– Mar 21 '15 at 10:54