def composeXML(self, tree, add_decl=1):

        """
        Retrieves a XML tree previously defined elsewhere and declaration is added
        if add_decl is 1.

        """

        worktree = tree
        tmptree = str(getnodes())
        if add_decl == 0:
            decl = self._gendecl()
            tree = decl + tmptree
        else: tree = worktree
        return tree

        Retrieves a XML tree previously defined elsewhere and declaration is added
        if add_decl is 1.

        
recipes/Python/498101_Simpliest_XML_generator/recipe-498101.py