Fix parsing of XML arrays

Previously only the first element of arrays were returned.