1. Center a rack in the oven and preheat the oven to 350 degrees F. Line a baking sheet with parchment or a silicone mat.
2. Sift together the flour, cocoa, espresso powder, baking soda, baking powder and salt.
3. Working with a stand mixer, preferably fitted with a paddle attachment, or with a hand mixer in a large bowl, beat the butter and sugar together on medium speed until pale, about 2 minutes; the mixture may be crumbly. Scrape down the sides of the bowl, add the eggs and vanilla and beat for another 2 minutes; don't worry if the mixture looks curdled. Reduce the mixer speed to low and mix in the dry ingredients in 3 additions, mixing only until a dough forms. Scrape down the sides of the bowl. Mix in the chopped nuts and chocolate, then turn the dough out onto a work surface and knead in any dry ingredients that might have escaped mixing.
4. Divide the dough in half. Working with one half at a time, roll the dough into 12-inch-long logs. Flatten both logs with the palm of your hand, so that they are ½ to 1 inch high, about 2 inches across and sort of rectangular, then carefully lift the logs onto the baking sheet. Sprinkle each log with a little sugar.
5. Bake the logs for about 25 minutes, or until they are just slightly firm. The logs will spread and crack - and that's just fine. Remove the baking sheet from the oven, put it on a cooling rack and cool the logs for about 20 minutes. (Leave the oven on.)
6. Working with one log at a time, using a long serrated knife, cut each log into slices between ½ and ¾ inch thick. Stand the slices up on the baking sheet - you'll have an army of biscotti - and baking the cookies again, this time for just 10 minutes.