Abtracted out building object tree from xml