@classmethod
def _replaceName(cls, filename, cpname, module=None):
    """ replaces name prefix of xml templates files

        :param filename: template filename
        :type filename: :obj:`str`
        :param cpname: output prefix
        :type cpname: :obj:`str`
        :param module: module name
        :type module: :obj:`str`
        :returns: output filename
        :rtype: :obj:`str`
        """
    if filename.endswith('.ds.xml'):
        filename = filename[:-7]
    elif filename.endswith('.xml'):
        filename = filename[:-4]
    sname = filename.split('_')
    if not module or module == sname[0]:
        sname[0] = cpname
    return '_'.join(sname)
