Thank you for your question.
Because of legal reasons and rules of this site, I am unable to write the actual letter for you. However, I can tell you about such a letter.
Such a letter is addressed to your niece, and includes the following information:
Salutation: for example: Dear Niece's Name.
The invitation: for example: a simple statement that says We would appreciate or invite you to visit us for the summer.
A sentence or two describing : for example: We miss you and are unable to travel out of country right now. You are welcome to stay with us during the time you are here, and we will show you the sites. (name some tourism sites).
A sentence or two about how she will be cared for. for example: You will be staying with us, and we will provide all transportation and food. We will ensure you are picked up at the airport upon your arrival; and we will ensure you are taken to the airport when your visit is completed.
A similar letter can be written addressed to the UK Immigration Services, by changing the perspective of the letter.
For example: To Whom It may concern
I have invited my niece to visit me at the following address in the UK. (then give address).
The purpose of her stay is "tourism and family visitation",
During her stay we will be providing her transportation, lodging, and meals.
We will ensure her departure upon completion of her stay.
CAUTION: The UK immigration warns sponsors that letters of invitation are no guarantee of an approved visa or entry.
CAUTION2: If this is for work based visa situations, the invitation letter is required and must come from the prospective employer.