You probably need something along these lines:
from lxml import etree
patterns = """[your xml above, fixed - it's missing the closing </Patterns>]"""
doc = etree.fromstring(patterns)
p_dict = {}
pat = doc.xpath('//Pattern')
for p in pat:
key = p.xpath('./@ID')[0]
vals = p.xpath('.//ShiftType/text()')
p_dict[key]=vals
p_dict
Output:
{'0': ['L', 'D'], '1': ['D', 'E']}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…