xslt = ET.fromstring(xslStr)
transform = ET.XSLT(xslt)
newdom = transform(dom)
print(str(newdom))
for i in newdom.findall('//character'):
    print(i.text)
for i in newdom.iter('character'):
    print(i.text)
for i in newdom.xpath('//character'):
    pass
How can I make my code more readable and DRYer when working with XML namespaces in Python?