Thank you all for your replies - it seems that there can be some very complex situations in families where illegitimate children are involved. It seems , too, that family tree construction is a very individual affair, rather than a cut and dried business.
But let me ask this. Suppose Miss X has an illegitimate child by Mr Y, and the child is given the surname of his/her mother, X. Regardless of what may happen next (eg the mother may go on to marry Mr Z and give the child the surname Z, etc, etc), shouldn't the child's name appear in the family trees of both Miss X and Mr Y, just as a matter of birthright? How it's done doesn't matter much- it's up to the individual tree-makers.
Chanel