The purchase procedure of a property in Valencia is performed in front of a notary, who will verify and supervise all the procedure. The sellers and the buyers must be personally present at that time or any other person who has been authorised through a power of attorney to do so on their behalf. The real estate agent will normally come with you also to support and supervise everything. Notaries in Spain must verify the ownership, debts, etc. of the properties and inform during the signature of the deed of the purchase, so different with other countries. The participation of a solicitor is not necessary in this case but you are free to hire one to supervise everything if you do not feel secure or confident with the procedure. In case there is a mortgage it will be cancelled before or at least at the same time of the purchase, but be sure that you must buy if free of debts.
The payment of the property is done by means of a bank check prepared by your Spanish bank (not possible from foreign bank accounts) and addressed to the buyer that you will personally give to him in front of the notary.
After this procedure you will get the full possession of the property, keys, and a copy of the deed of the property on your name.
If you want to know more information about a purchase procedure in Valencia then check it out this post: What do you need to know after the purchase?