Fixed warnings, updated XML to JSON conversion to follow http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html