Added encoding parameter for ElementTree.tostring