Serializing the book Object to a File
Next, you serialize your book object out to a file. Because the XML format generated by XML streams is difficult to read, transform the output stream into a more readable format.
Each of the following sections considers first a character-based C++ transformation, followed by an element-based C++ transformation.