Program doesn't produce any error or output
<p>I have the following Python program:</p>

<pre><code> import xml.etree.ElementTree as ET
    import sys   

    class MyXmlParser(object):

        def __init__(self, users):
            self.doc  = ET.parse("users.xml")
            self.root = self.doc.getroot()

        def do_something(self, output = sys.stdout):
            root_new  = ET.Element("users") 
            for child in self.root:
                username             = child.attrib['username']
                password             = child.attrib['password']   
                # create "user" here
                user    = ET.SubElement(root_new, "user") 
                user.set("username",username)               
                user.set("password",password) 
                # checking attribute - skip KeyError
                try:
                    remote_access   = child.attrib['remote_access']
                    user.set("remote_access", remote_access) 
                except KeyError:
                    pass

                for g in child.findall("group"):
                    # create "group" here
                    group     = ET.SubElement(user,"group")  
                    if g.text != "lion":
                        group.text = g.text 
            tree = ET.ElementTree(root_new)
            tree.write(output)
if __name__ =='main':
    parser = MyXmlParser()
    parser.do_something()
</code></pre>

<p>And this is my xml :</p>

<pre><code>&lt;users&gt;
&lt;user username="admin"  password="admin" remote_access="yes"&gt;&lt;/user&gt;
&lt;user username="private_user1" password="user1" &gt;&lt;group&gt;group1&lt;/group&gt;&lt;group&gt;group2&lt;/group&gt;&lt;/user&gt;
&lt;user username="private_user2" fullname="user2" password="user2"&gt;&lt;group&gt;group1&lt;/group&gt;&lt;group&gt;group2&lt;/group&gt;&lt;/user&gt;
&lt;/users&gt;
</code></pre>

<p>I can't find any mistake in this program. It should output some xml. But presently it's not giving any error or output. I expected some xml as output :( Thanks in advance</p>
