from the City of Ten Thousand Buddhas website - the Flower Adornment Sutra, commentary by Hsuan Hua:
"When you have advanced to a certain level in your cultivation, the demons will come to test you out, to see if you have any skill. Demons come to polish the True Way; Those on the True Way have to endure demons. The more you're polished, the brighter you become; The brighter you get, the more you must be polished. You'll be polished until you're like the autumn moon, Illumining all the demon hordes from space. When the demon hordes are scattered, The original Buddha manifests. Cultivators should not fear demons. Demons just come to test you to see if you have gongfu [spiritual skill]. Right now there are many demons coming to test all of you: heavenly demons, earthly demons, human demons, ghostly demons, and demons of sickness. They are testing you to see if you are genuine or phony. If you are phony, the demons will leave you alone. If you are genuine, the demons will be subdued and will also leave you alone. It's only to be feared that you are partly genuine and partly phony. Then the demons will advance some and retreat some. They will get close to you, then draw away from you, then get close again, always hanging around you. Though they hang around, you need not be afraid. You can either become more genuine, or become more phony.