You can use the retirement fund to buy real estate however you will have to comply with stringent rules as laid out by the IRS. You will have to use a custodian for your account that will guide you through the rules and regulations of the IRS tax code and make sure that you are in compliance at all time.
The IRS has ruled that your self-directed IRA or 401K can't invest with yourself, your spouse, or direct descendents. However, there are ways to accomplish investing by forming LLC's or Limited Partnerships or other similar vehicle. In fact there are many custodian and administrator companies that can help you and answer your questions. such as
Let me know if you have any question.
Please note: This advice is provided with the understanding that all the relevant facts have been provided by you. Any change in facts might affect the advice given and hence may not be relied on in such cases. Nothing contained in this reply was intended or written to be used, can be used by any taxpayer, or may be relied upon or used by any taxpayer for the purposes of avoiding penalties that may be imposed on the taxpayer under the Internal Revenue Code of 1986, as amended.