If I get discounted building costs (Because I'm a cleric) does that also discount my construction XP?
Yes.
IE: A cleric and a fighter each want to build a stronghold worth 22,500 to secure some land. The cleric pays 11,250 because he's a cleric. Does he then collect only 5625 xp?
The cleric would collect 5,625xp because he spent 11,250gp on his stronghold.
Can the player invest the full 22,500 even if he's not going to secure that much land in the short term and have an opulent church indeed?
If the cleric spent 22,500gp on his stronghold, he would get 11,250xp. He'd be able to secure a larger territory with such a domain, giving him "room to grow". However, it would also impose a larger stronghold upkeep cost going forward - it is very easy to bankrupt a young domain with an overly large stronghold. It would also increase the unit capacity of his stronghold, which is a mixed blessing. Larger strongholds can be assaulted by the number of units equal to their unit capacity, and thus require more troops to defend.
There are, for a cleric, four basic ways that funds could be spent in a domain: (1) on stronghold construction; (2) on congregants; (3) on domain investment; and (4) urban investment. You can typically leave it up to the player to decide what spending counts as what, provided that it makes sense in-world and is reflected appropriately in the game mechanics. For instance, spending 20K gp on a church would be congregant spending, typically, because it would be fancy woods, altars, pews, stained glass, etc.. If the 20K gp expenditure was to add walls and a "crusader's barracks" to the church, that would be stronghold construction, though. And if the 20K was to add an orchard and a mill and create a monastic farming community, that might be investment.
What happens if a player leaves their domain? I can imagine many scenarios where a player clears some wilderness to act as a base, but then later captures a bigger castle, realizes that another location has more strategic value, gets awarded land by the king, just wants to build another castle and has a cooler layout this time, etc, and assigns a hench to be caretaker of his old land and moves into the new stronghold.
A player who voluntarily abandons his stronghold and ends up with no stronghold would lose his stronghold XP. He can regain this as usual. It doesn't matter whether he gives it to a vassal or not. No stronghold, no XP!
EXAMPLE: Roghan builds a 25,000GP stronghold. He gains 12,500XP. He later decides to abandon his domain and become a wanderer again, finding the burden of the crown too much. He loses 12,500XP. When Roghan returns, and reclaims the castle, he gets his XP back.
A player who enfiefs his stronghold to a vassal so that can rule a stronghold of equal or larger value does not lose his stronghold XP. If he were to lose his new stronghold, he would lose only the vlaue of stronghold XP he'd gotten initially. If his vassal were to lose the old stronghold, there would be no effect on the player character.
EXAMPLE: Roghan captures a 100,000GP stronghold. He assigns his old stronghold to his vassal, Zelligar. Later, in battle, Zelligar's 25,000GP stronghold is captured. This has no effect. But when Roghan's new 100,000GP stronghold is destroyed, Roghan loses XP - 12,500XP (the value he got from building his first stronghold).
Although it is not in the rules-as-written, I personally award stronghold XP equal to 1/2 (GP value of new stronghold - current stronghold), if the player makes the new stronghold the seat of his personal domain. He is at risk of losing all of his cumulative XP if he loses his new stronghold, though.
EXAMPLE: Roghan captures a 100,000GP. He assigns his old stronghold to his vassal Zelligar. Roghan gains (100,000-25,000)/2 37,500XP. If he loses his new stronghold, he loses 50,000XP.
This latter mechanic explains why Sauroman was so weak once he lost his tower. :-D
I also award stronghold XP for capturing an initial stronghold, rather than building one. There were some differences of opinion within the Autarch studio on this rule during the design period, so it didn't make it into the final rules. (Tavis and Greg were more focused on earning the XP for spending the gold, whereas I was more focused on earning the XP for getting a stronghold).