Thanks for your reply. I looked into it, especially the part dealing with trees, i.e.
HWTree (Hull-White model using a tree). However, it can only be used as a parameter for other functions and does not explicitly constructs the HW trinomial tree (through the two-stage approach described by Hull and White). If you find anything more specific on codes about building HW trees, please let me know. Thanks again.