\subsection{Game serializer}
\label{sec:serializer}

The game serializer, contained in the \texttt{gizmoball.xml} package,
is responsible for loading and saving game board states in the
standard Gizmoball XML format.  This package itself uses Java's DOM
API for reading and writing the necessary XML data.

The loading and saving of game board states is divided into two
classes: \texttt{GizmoballReader} and \texttt{GizmoballWriter}.
\texttt{GizmoballReader} is a static factory responsible for loading
an existing game state.  It operates by using the standard GameBoard
constructor to construct an empty board, then populating it with
gizmos and connections as the XML data is traversed.
\texttt{GizmoballWriter} performs the reverse, taking in a file (which
may or may not exist) and an already populated GameBoard and writing
the appropriate XML data to the file.  Both of these processes can be
initiated by the user through the user interface.

% Assume Petra is the best pinball player ever
