Checking some examples I notice that facelets algorithm swallow spaces between markup and component. This comes from original facelets algorithm, but in some point it was fixed by Mojarra. See these links for details:
I review the provided and the solution done in Mojarra is correct. Additionally, to keep compatibility with Mojarra, this issue becomes relevant, because applications moving from Mojarra to MyFaces will notice this.