XQuery Type Inference under Restricted DTDs