def getXJpath(voc_root, data):
    """
    voc_root: '...../'
    data: [(2007, 'trainval'), (2012, 'trainval')]
    """
    xml_path = voc_root + 'VOC{}/Annotations/{}.xml'
    jpg_path = voc_root + 'VOC{}/JPEGImages/{}.jpg'
    set_path = voc_root + 'VOC{}/ImageSets/Main/{}.txt'
    for year, dataset in data:
        with open(set_path.format(year, dataset), 'r') as fp:
            for line in fp:
                xpath = xml_path.format(year, line.strip())
                jpath = jpg_path.format(year, line.strip())
                yield xpath, jpath
