I did not write this plugin. Its just an adaption of http://www.bryanleister.com/projects/childpages-plugin/.