minor corrections ad comments
updated and corrected XML output