the b
flag in front of the string shows you that it's a byte string. To print that as a unicode string (which is the typical encoding for a Python string), you can do:
print(etree.tostring(root,pretty_print=True).decode())
or etree.tostring
has a flag that allows you to set the encoding, so:
print(etree.tostring(root,pretty_print=True,encoding='unicode'))
Either way works for me. Here's more information on Byte Strings and Strings