Thank you for the feedback. I have done a number of Google searches and there does not seem to be a standard way to accomplish this. I like the idea of putting the XPS foam on top of the wall as well and then I could seal it with tuck tape so it would create an air tight seal all across the wall. The other idea I had was if I used pressure treated wood on the top, I could us those boards to support the wall instead of having to use tapcon screws and anchor them to the wall. Also, I have enough space below the window to put a pressure treated 2x4.
This image has been really helpful for me but my situation is a bit different since my concrete ledge is a bit wider and they built the wall above the concrete. It makes me wonder if there is a standard height for ledges. Also, they did not put the XPS board on top of the wall.