I was surprised that XML basic object (twisted.words.xish.domish.Element) could not be created entirely from XML string. The most alike way is:
msg = "<iq to='[email protected]' id='id123' type='get'> \
<query xmlns='http://juick.com/query#messages' mid='123456'/> \
</iq>"
iq = domish.Element(('',''))
iq.addRawXml(msg)
But it generates:
iq.toXml()
u"<><iq to='[email protected]' id='id123' type='get'> <query xmlns='http://juick.com/query#messages' mid='123456'/> </iq></>"
Is there any way to use raw XML except writing my own IElement implementation?