Poly(carboxylic acid) hydrogel films and hollow capsules undergo reversible size changes in response to variations in pH and/or ionic strength. The films and capsules were obtained from hydrogenbonded poly-N-vinylpyrrolidone/poly(carboxylic acid) layer-by-layer films by chemical crosslinking of the polyacid, followed by pH-induced removal of poly-N-vinylpyrrolidone. Surface-attached hydrogel films present attractive matrices for reversible pH-stimulated loading and/or controlled release of large amounts of synthetic or natural macromolecules including proteins. By varying acidity of poly(carboxylic acids), the hydrogel swelling and the corresponding values of pH for encapsulation/release of functional molecules could be tuned in a wide range from pH 5 to 10. In addition, the capsules are capable of entrapping macromolecules by "locking" the capsule wall with an electrostatically associating polycation, followed by the release of the encapsulated macromolecules at high salt concentrations.