I am confused about this word "attached" when I receive a letter begins like this: Dear XX, attached is a document for…… Here, the word "attached" is used somehow like a noun which means attachment, is that right?
 Dear XX, a document for x is attached.
 Dear XX, attached is a document for x
No: "attached" is not a noun but an adjective.
This is about subject-dependent inversion:
 is the basic version, but  combines the preposing of the AdjP "attached" and postposing of the subject NP "a document for x".