The presence of XML in many recent hypermedia management tools and methods (W3I3, SMIL, etc.) shows better than ever that both structural and textual criteria will continue to play a fundamental role in content-based multimedia retrieval and management. Extracting precise and fine-grained information from structured documents requires powerful pattern-matching. Most existing XML query languages are fairly limited in this respect. Powerful pattern-matching languages do exist, but usually lack the data manipulation capabilities required of a true information management environment. In this paper, we investigate how XGQL, a powerful pattern-matching language based on generalized grammars, can be integrated into SgmlQL, a complete XML retrieval and manipulation language.