Alanna: The First Adventure by Tamora Pierce
And so young Alanna of Trebond begins the journey to knighthood. Alanna has always craved the adventure and daring allowed only for boys; her twin brother, Thom, yearns to learn the art of magic. So one day they decide to switch places: Disguised as a girl, Thom heads for the convent; Alanna, pretending to be a boy, is on her way to the castle of King Roald to begin her training as a page. But the road to knighthood is not an easy one. As Alanna masters the skills necessary for battle, she must also learn to control her heart and to discern her enemies from her allies. Filled with swords and sorcery, adventure and intrigue, good and evil, Alanna’s first adventure begins—one that will lead to the fulfillment of her dreams and make her a legend in the land.