A nine-year prison sentence has been handed to a man found guilty of attempting to rape a young girl, Oxford Crown Court has heard.