restructured how code is organized, added exception-handling when a
non-well-formed XML is produced, and PWMs can contain lower-case
characters.