Smelting, or simply cooking, certain ores and food do get you a lot of XP. A furnace is probably something you'll craft on your very first day, and it's something that'll allow you to milk quite a bit of XP from. Smelting iron and gold are great ways to get XP. However, cooking food is has double the benefits. Not only are you going to be earning XP points, but you're also going to get better hunger and saturation points.
If you don't already know, breeding gets you an XP orb every time a baby animal is born. If you're just starting out, you should definitely think about trapping some animals on your first or second day. Breeding comes a bit later, but it should definitely be on your to-do list. Once you start breeding, you should get a fair bit of XP in a few days. After that, you can also go fish for XP. Fishes also get you XP orbs every time you catch one, regardless of whether you pick it up or not.