only pop elements if we can
add unittest skeleton for xml_driver