My 3x3x3 and 5x5x5 LED cube

The digital pins from the arduino can only sink(/source) up, up to 40mA. If I turn on 25 LEDs on one layer the total current that need to be sinked by the digital pin would be 25*13mA = 325mA, this is far too much for a digitalpin. Instead I use NPN transistors, the collector from the transistor is connected to each layer of the cube. The emitter is connected to ground from the arduino (Ground from the arduino can sink up to around 450 mA on USB) and the base is connected to a digital pin on the arduino (in my case to the shift register). Now I am able to turn on 25 LEDs on one layer without frying something. The other advantage from transistors is the way how the ground is turned on/off, I send a HIGH signal to the base from the transistor so it switches the selected layer to ground. Because I can use HIGH instead of LOW (what you mentioned) it makes it easier to program.