Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from lxml import etree
- node = etree.Element('node')
- node.append(etree.Element('child'))
- # another child with text
- child = etree.Element('child')
- child.text = 'some text'
- node.append(child)
- s = etree.tostring(node, pretty_print=True)
- print s
Add Comment
Please, Sign In to add comment