Chapter 7
Data Serialization
Section 2
Level 7 - Problem 1
Write a program that can serialize a list of movies to an XML file, and deserialize an XML file with a list of movies. Each movie has a numerical identifier, title, release year, length in minutes, a list of directors, a list of writers, and a list of casting roles with actor name and character name. Such an XML may look like the following: <?xml version="1.0"?> <movies> <movie id="9871" title="Forrest Gump" year="1994" length="202"> <cast> <role star="Tom Hanks" name="Forrest Gump" /> <role star="Sally Field" name="Mrs. Gump" /> <role star="Robin Wright" name="Jenny Curran" /> <role star="Mykelti Williamson" name="Bubba Blue" /> </cast> <directors> <director name="Robert Zemeckis" /> </directors> <writers> <writer name="Winston Groom" /> <writer name="Eric Roth" /> </writers> </movie> <!-- more movie elements --> </movies>