Added parsing of XML. Still needs cleaning