There are probably a hundred different ways to do what you want. You could certainly do it with sed or awk, for example, though I don't know the syntax for them offhand. But a quick and dirty way I've used is something like this:
echo -e "xxx\n$(cat example_file.txt)" > example_file.txt
Edit: here's a solution using sed:
sed -i 1i\ xxx example_file.txt
The -i flag in sed makes it modify the original file in place, 1i\ means insert text at line one, and is followed by the text you want to insert.