See the 'Copying filedocuments' section in our API tutorial
An attribute of a IMendixObject can be set using:
fileDocument.setValue(context, "Name", "Test file");
Edit: Or as Bas suggested, using the proxy:
fileDocument.setValue(context, system.proxies.FileDocument.MemberNames.Name, "new name");