Convert XML to array