fix bug where #text was considered as childnode