Preheat the oven to 400°F (200°C).
Wash and prick the sweet potatoes with a fork, then place them on a baking sheet.
Bake sweet potatoes for 45-60 minutes, or until tender.
While the sweet potatoes are baking, prepare the filling. In a pan, combine cranberries, diced apple, pecans, maple syrup, cinnamon, nutmeg, salt, and pepper.
Once the sweet potatoes have cooled, slice them in half lengthwise and scoop out the flesh into a bowl, leaving a thin layer intact.
Mash the sweet potato flesh with the prepared cranberry-apple mixture and cream cheese if using.
Spoon the mixture back into the sweet potato skins and place them on a baking dish.
Bake the filled sweet potatoes for an additional 20-25 minutes, until heated through.
Remove from the oven, let cool slightly, and serve warm.