\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}

% This is a LaTeX file that uses a package called "tikz".  To include a tikz
% image in your document, put \usepackage{tikz} and any \usetikzpackage{...}
% commands between \documentclass{...} and \begin{document}.  Everything between
% \begin{tikzpicture} and \end{tikzpicture} defines the picture.

\usetikzlibrary{automata}

\begin{document}


\begin{tikzpicture}
\node[state, initial, accepting] (q1) at (0,0) {$q_1$};
\node[state]                     (q2) at (3,0) {$q_2$};

\draw[->] (q1) edge[loop above] node[above] {1} (q1)
               edge[bend left]  node[above] {0} (q2)
          (q2) edge[loop above] node[above] {1} (q2)
               edge[bend left]  node[below] {0} (q1);
\end{tikzpicture}

\end{document}
