For the top action, the number of cards you have lost is equal to the cards in your lost pile plus any lost cards in your active area. If you recover any lost cards, they no longer count toward the total.
For the bottom action, the XP gain is part of the attack, so if you can perform the attack, you get the XP.