Hi Hannah,
I've had similar problems and I have too used the xpath now() function to generate a unique file string. This function specifically:
concat("filename_", substring(now(), 1, 4), substring(now(), 6, 2), substring(now(), 9, 2), substring(now(), 12, 2), substring(now(), 15, 2), substring(now(), 18, 2))
I'm not 100% but I don't think you will be able to get at the ID value before the item exists in the library.
Previously I've had to resort to using an event handler in the library which updates a hidden value within the xml - the filename of the infopath form saved. Then when the form is resubmitted the event handler detects this value, deletes the old file and renames the new file back to its original name.
a bit of a hack but it did the trick!
regards,
richard
Richard J Kennedy
Trinity Expert Systems