The answer to the first question is
completely wrong.
You can achieve what you want by
<!ELEMENT basket
(banana,banana,(banana,banana?)?)>
So DTD is completely fine in this case.
Also, it's worth mentioning that the following DTD violates the deterministic constraint of DTD.
<!ELEMENT basket (
(banana,banana,banana)|
(banana,banana,banana,banana)|
...
>
Thus it's not OK.
|