pip install xl@git+https://github.com/meng89/xl#egg=xl
xl@git+https://github.com/meng89/xl#egg=xl
import xl
doctype = xl.DocType("html")
html = xl.Element("html")
body = xl.sub(html, "body")
p = xl.sub(body, "p")
p.kids.append("Hello World!")
xml = xl.Xml(doctype=doctype, root=html)
print(xml.to_str())
import xl
xml_string = """<!DOCTYPE html>
<html><body><p>Hello World!</p></body></html>"""
xml = xl.parse(xml_string)
html = xml.root
body = html.kids[0]
p = body.kids[0]
print(p.kids[0])