with t (educationeventid, xml_part, iter) as ( select cast(educationeventid as varchar(255)) , substr(substr(xml,641), locate(' 0 union all select t.educationeventid, rtrim(substr(xml_part, locate(' 0 and iter < 20 ), tuples (t1, t2) as ( select educationeventid, rtrim(substr(xml_part, locate('"', xml_part)+1, locate('"/>', xml_part) - (locate('"', xml_part)+1))) from t where iter > 1 )