def Printnode(node):
if node.text is not None:
print node.text
fw.write('\n'+node.text)
if(list(node)):
for child in node:
Printnode(child)