para = doc.createElement('para') chapter.appendChild(para) para.appendChild(doc.createTextNode("B")) company = doc.createElement('company') para.appendChild(company) company.appendChild(doc.createTextNode('C'))
para.appendChild(doc.createTextNode('.'))
print doc.toprettyxml(indent = ' ')
Related Scripts with Example Source Code in same category :