CreateEntries uses actual paths. You need to use the CreateEntry method with a prefix concatenated to actual file or folder name.
In your case, you need to implement a recursive or queue-based traversal algorithm: visit root (myfolder), visit its leaves (files), then visit branches (subfolders), making each branch the new root for the next level. Let me know you if you need assistance.