added XML parse function