NOVELTY - Preparing polymer membranes from aromatic polyimide membranes, comprises: (a) providing or synthesizing a polyimide polymer; (b) fabricating polyimide membranes from the polyimide polymer; (c) heating the polyimide membranes at a temperature of 300-600 degrees C under inert atmosphere or vacuum for 30 seconds to 1 hour to produce a heated polyimide membrane; and (d) exposing the heated polyimide membranes to a crosslinking treatment.    USE - The polymer membrane is useful for separating gas or liquid (claimed). The polymer membrane is useful for vapor separation such as desalination of water, non-aqueous liquid separation such as deep desulfurization of gasoline and diesel fuels, and ethanol/water separation. The polymer membrane is useful in catalysis and fuel cell applications.    ADVANTAGE - The polymer membrane exhibits excellent proton conducting property, high water adsorption capacity and high chemical and thermal stability.    DETAILED DESCRIPTION - Preparing polymer membranes from aromatic polyimide membranes by thermal treating and UV crosslinking, comprises: (a) providing or synthesizing a polyimide polymer, where the polyimide polymer contains pendent hydroxyl or thiol groups ortho to a heterocyclic imide nitrogen and UV crosslinkable functional groups in a polymer backbone; (b) fabricating polyimide membranes from the polyimide polymer; (c) heating the polyimide membranes at a temperature of 300-600 degrees C under inert atmosphere or vacuum for 30 seconds to 1 hour to produce a heated polyimide membrane; and (d) exposing the heated polyimide membranes to a crosslinking treatment. An INDEPENDENT CLAIM is included for separating at least one gas or liquid from a mixture of gases or liquids using the polymer membrane, comprising: providing the polymer membrane; contacting a mixture of gases or liquids on one side of the polymer membrane prepared from the aromatic polyimide membrane by thermal treating and UV crosslinking to cause at least one gas or liquid to permeate the membrane; and removing from an opposite side of the membrane a permeate gas or liquid composition that is a portion of the at least one gas or liquid that permeated the membrane.