def XCOMmaterial(massdic):
    """
    Function to convert the mass percentages into XCOM readable input string
    
    Parameters
    ----------
    massdic : dict
        Dictionary which stores the mass percentage for each element (which are the keys).
    
    Returns
    -------
    xcomstr : str
        String which includes the elementwise mass percentages in an XCOM readable form.
    """
    #printf 'spentfuel\n4\n2\nH\n0.1\nO\n0.9\n1\n3\n1\n3\n0.6\n0.8\n0.9\nN\ntestauto.out\n1\n' | ./XCOMtest
    xcomstr=''    
    for element in massdic:
        xcomstr=xcomstr+element+'\n'+str(massdic[element])+'\n'
    return xcomstr