Reading and writing XML files

XML or Extensible Markup Language is a popular markup language. It was designed to be both human- and machine-readable, but with an apparent emphasis on the later. XML is very widely supported and commonly used for file formats of various programs. For example, the popular Open Document Format is XML-based. The popularity of XML is mostly due to its historical use and support. It is often replaced by lighter languages such as JSON because of XML's relative verbosity and complexity. We will assume that the reader has a basic working knowledge of XML. However, to recap the basics, XML consists of tags and text. Tags are the start and end varieties. Start tags look like this: <tag>, while end tags look like this:

Get Scientific Computing with Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.