Added Header to XML Output and tidied line value parsing