Can the word "attached" used as a noun?
Solution 1:
[1] Dear XX, a document for x is attached.
[2] Dear XX, attached is a document for x
No: "attached" is not a noun but an adjective.
This is about subject-dependent inversion:
[1] is the basic version, but [2] combines the preposing of the AdjP "attached" and postposing of the subject NP "a document for x".
Solution 2:
No, attached is an adjective adjected to the noun document. What confuses you is the word order. Your example is equivalent to
.. a document for .. is attached.
Changing the word order does not change the role of attached.