Another hard day's work, rewrote XML parsing using jdom2.