Hi,
Please, take a look at the Tree Data Import example. It demonstrates most of the features you require.
You can easily make the document fit the size of the layouted shapes by calling the document.SizeToContent() method.