is an inline 6 as powerful as a v6 when at the same size?
Unfortunately, it's not that simple. If every condition and factor were the same with the exception of the cylinder layout, then the engines would be pretty similar in terms of power output. However, the inline motor would have the slight edge, revving more smoothly and more eagerly than its V-shaped counterpart. But like I said, it's easier to fit V-engines into engine bays, which is why we have V-8s and what not instead of I-8s. Look at it this way, in terms of configuration:
3.2-liter V-6
o o o
o o o
3.2-liter I-6
o o o o o o
3.5-liter V-6
O O O
O O O
3.5-liter I-6
O O O O O O
While the above diagrams aren't the most accurate, it'll give you a basic idea of the packaging. The V-6 configuration of a certain displacement is easier to fit in a specific engine bay versus the I-6 configuration of the same displacement. However, if you were to enlarge the displacement, the V-6 wouldn't be too much larger, while an I-6 of the same larger displacement would begin to be too long. So this is why BMW never really wanted to keep increasing the displacement of their I-6 engines, with the 3.2-liter of the outgoing M3 being the largest. Otherwise, they'd have to switch to the V-6 if they were to use bigger motors (like Nissan/Infiniti and Toyota/Lexus did), which is something that BMW would never want to do.