xml_parser: check array length index before accessing the array.