<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_attributes(cls, server, dbname, username, dbclass, port=None, query_band=None, initial_sql=None, authentication=''):
 """Creates a new connection that can be added into a Data Source. defaults to `''` which will be treated as 'prompt' by Tableau."""


        root = ET.Element('connection', authentication=authentication)
        xml = cls(root)
        xml.server = server
        xml.dbname = dbname
        xml.username = username
        xml.dbclass = dbclass
        xml.port = port
        xml.query_band = query_band
        xml.initial_sql = initial_sql

        return xml