Code:
<CivilopediaPageExcludes>
<Row SectionId="BUILDINGS" PageId="BUILDING_SOMETHING"/>
</CivilopediaPageExcludes>
Causes the game to not make a seperate civilopedia page for the specified building. However, if the building is mutually exclusive with another "real" building, or the building is a prereq for a "real" building, that will be shown on the civilopedia page for the "real" building.
In order to hide a building from the tech (or civics) tree just make the building its own prerequisite, and remove any reference to a prerequisite technology or civic. Doing so also acts as a "lock-out" so the building cannot be constructed but it will still show in the city view on the production menus (as currently unavailable) and lists of constructed buildings if placed in the city via lua (for example).
I remember some issues with InternalOnly so I moved on to using the "its own prereq" method and then re-wrote all the UI files so that if the building is defined as a dummy or has an unsatisified building-prerequisite it does not show anywhere in the production qeue (selection) or elsewhere in the UI. This re-writing of the UI files makes my mod instantly non-compatible with QUIC or whatever it is as well as the Production Qeue mod.