I want to create a documentlibrary on the parent site of a bunch of subsites. All those subsites have their own documents. I want the parent documentlibrary to contain all those documents of the sub sites. How can I accomplish this.
If you really really want to duplicate your SharePoint data twice then you can do something like this,
I developed this code on Note pad so there might be some compilation errors, other then that you can add more code to it so that you can add returned SPFile to your newly created document library.
Once above step is done, you can add event receivers to all of your sub web's document libraries so that if a new document is added you copy it to your parent doc library too.
But If you are using SharePoint 2010, you can use Document Repository or configure Send To settings.
A Document Library is a place to store documents, not a place to reference documents in other places. What it sounds like you want is some sort of index of all the documents in the subsites; for that, I believe the Content Query Web Part may fit the bill.