Self-catalytic etching of silicon: from nanowires to mesopores