from xml.dom import minidomdoc = minidom.Document()print doc.toprettyxml("", "", "UTF-8")如果解决了您的问题请采纳!如果未解决请继续追问