def METHOD_NAME(fname,pts,conn,ccdata,ncdata):
    outfile=open(fname,'w')
    Npts=pts.shape[0]
    Ntri=conn.shape[0]
    zero=0
    outfile.write("<?xml version=\"1.0\"?>\n")
    outfile.write("<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n")
    outfile.write("<UnstructuredGrid>\n")
    outfile.write("<Piece NumberOfPoints=\"%d\" NumberOfCells=\"%d\">\n"%(Npts,Ntri))
    outfile.write("<PointData>\n")
    n_ncdata=ncdata.shape[0]
    if(n_ncdata > 0):
        for ndataset in range(n_ncdata):
            outfile.write("<DataArray type=\"Float32\" Name=\"Point_data%d\" format=\"ascii\">\n"%(ndataset))
            for i in range(ncdata.shape[1]):
                outfile.write("%e "%(ncdata[ndataset][i]))
            outfile.write("\n</DataArray>\n")
    outfile.write("</PointData>\n")
    outfile.write("<CellData>\n")
    n_ccdata=ccdata.shape[0]
    if(n_ccdata > 0):
        for ndataset in range(n_ccdata):
            outfile.write("<DataArray type=\"Float32\" Name=\"Cell_data%d\" format=\"ascii\">\n"%(ndataset))
            for i in range(ccdata.shape[1]):
                outfile.write("%e "%(ccdata[ndataset][i]))
            outfile.write("\n</DataArray>\n")
    outfile.write("</CellData>\n")
    outfile.write("<Points>\n")
    outfile.write("<DataArray type=\"Float32\" Name=\"Points\" NumberOfComponents=\"3\" format=\"ascii\">\n")
    for i in range(Npts):
        outfile.write("%e\t%e\t%e\t"%(pts[i][0],pts[i][1],zero))
    outfile.write("\n</DataArray>\n")
    outfile.write("</Points>\n")
    outfile.write("<Cells>\n")
    outfile.write("<DataArray type=\"Int64\" Name=\"connectivity\" format=\"ascii\">\n")
    for i in range(Ntri):
        for j in range(3):
            outfile.write("%d "%(conn[i][j]))
    outfile.write("\n</DataArray>\n")
    outfile.write("<DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">\n")
    for i in range(Ntri):
        offs=3*(i+1)
        outfile.write("%d "%(offs))
    outfile.write("\n</DataArray>\n")
    outfile.write("<DataArray type=\"Int64\" Name=\"types\" format=\"ascii\">\n")
    for i in range(Ntri):
        tri_type=5
        outfile.write("%d "%(tri_type))
    outfile.write("\n</DataArray>\n")