XML Document Inversion¶
Write a program, preferably in Java (Python is also acceptable), that reads an XML file from disk, inverts parent-child element relationships and prints the result to the standard output (System.out
). For example, passing the following XML as input to your program:
should produce the output below:
Libraries¶
You are allowed (and strongly encouraged) to use existing built-in/open-source libraries to parse XML documents instead of developing your own XML parser.