学习python ElementTree

import xml.etree.ElementTree
tree =  xml.etree.ElementTree.ElementTree(file="C:\config.xml")
#tree.write("mx.xml")
#tree.write("kdk.xml","utf_8")
elem = tree.getroot()
for aa in elem.getiterator("cfg"):
    method = aa.find("ModifyMethod")
    print method.text
    dict = aa.find("ToBeModifiedSecion")
    print dict.text
xml
C:\usr\local\gemini\mgw\etc\mgw.properties
replaceByKeyValue{
"QUEUEMGR.maxdata":"20","QUEUEMGR.maxindexes":"1500",
"SIDELINEQUEUE.maxdata":"20","SIDELINEQUEUE.maxindexes":"1500"
}
C:\usr\local\gemini\mgw\etc\mgw.propertiesreplaceByKeyValue  {
"QUEUEMGR.maxdata":"23330","QUEUEMGR.maxindexes":"1500",
"SIDELINEQUEUE.maxdata":"24440","SIDELINEQUEUE.maxindexes":"1500"
}