1. A computer-implemented method of generating a query implementing a schema mapping in a computing environment, said method comprising: providing a mapping M from a schema S to a schema T, said mapping M relating said schema S to said schema T, said mapping M expressed as a plurality of constraints included in a set D of one or more nested tuple-generating dependencies that relate said schema S to said schema T, said schema S comprising a first set of one or more elements and said schema T comprising a second set of one or more elements, wherein said schema T includes at least one set type element; traversing, in pre-order, each set type element that is included in said second set of one or more elements of said schema T, wherein said traversing includes visiting an element E of said second set of one or more elements; identifying at least one nested tuple-generating dependency (nested tgd)m 1 ,. .. , M k of said set D, wherein a target generator of a plurality of target generators of a nested tgd m i of said m 1 ,. .. , m k includes said element E, wherein said m i is of a form: for (x 1 in g 1 s ). .. (x n in g n s ) where B 1 (x 1 ,. .. , x n ) exists (y 1 in g 1 t ). .. (y m in g m t ) where B 2 (y 1 ,. .. ,y m ) with (e 1 s = e 1 t ) and. .. and (e k s = e k s = e k t ), wherein x 1 ,. .. , x n and y 1,. .. , Y m are variables, wherein e 1 s ,. .. ,e k s are plurality of source expressions of atomic type, wherein e 1 t ,. .. , e k t are a plurality of target expressions of atomic type, wherein each expression of said plurality of source expressions and said plurality of target expressions is a variable, a schema root, or a record component of another source expression, wherein said g 1 s ,. .. g n s are a plurality of source generators, wherein said g 1 t ,. .. , g m t are said plurality of target generators, wherein an i-th source generator g i S of said plurality of source generators g 1 s ,. .. , g n s depends upon a first root of one or more roots of said schema S or upon variables x 1 ,. .. , x i-1 of said variables x 1 ,. .. , x n , wherein a j-th target generator g i t of said plurality of target generators g 1 t ,. .. , g m t depends upon a second root of said one or more roots of said schema S or upon variables y 1 ,. .. , y j-1 ,wherein B 1 (x 1 ,. .. , x n ) is a source predicate, and wherein B 2 (y 1,. .. ,y m ) is a target predicate; for each mof said m 1 ,. .. , m k , obtaining a query terms t 1 ,. .. , T k , wherein said obtaining said query term t i includes constructing a select distinct clause, a from clause, and a where clause as said query term t i wherein said select distinct clause specifies a return tuple that includes one or more expressions, wherein each expression of said one or more expressions is a source expression of said plurality of source expressions e 1 s ,. .. , e k s if said source expression is associated with an atomic element A of said one or more atomic elements, or a first Skolem function that includes any expression included in said select distinct clause that is not a Skolem function if no source expression of said plurality of source expressions is associated with said atomic element A; constructing a first SetId identifier that includes a second Skolem function, wherein said second Skolem function includes, as one or more parameters therein, each expression of said one or more expressions that is not said first Skolem function; adding said first SetId identifier to said select distinct clause of said query term t i ; adding a second SetId identifier to said select distinct clause of said query term t i if said element E is not a top-level set type element, wherein said second SetId identifier is a SetId identifier of an element P, and wherein said element P is an ancestor of said element E in said schema T; adding said second SetId identifier to said one or more parameters included in said second Skolem function included in said select distinct clause of said query term t i if said element E is not said top-level set type element; adding said second SetId identifier to said first Skolem function if said element E is not said top-level set type element and if said select distinct clause of said query term t i includes said first Skolem function; generating a query Q1as a union of said query terms t 1 ,. .. , t k subsequent to said obtaining a query term t i for each m 1 of said m i ,. .. , m k ; generating a query Q2 that nests a plurality of tuples resulting from an evaluation of said query Q1; generating a query Q capable of implementing said mapping M, wherein said query Q is a sequence of said query Q1 followed by said query Q2; storing said query Q in a data storage unit; applying said query Q to an input, wherein a result of said applying is an instance J in which no element instance of said instance J is a duplicate of another element instance of said instance J, wherein said instance J conforms to schema T, wherein said input is an instance I conforming to said schema S, wherein said instance I and said instance J satisfy said plurality of constraints of said mapping M, and wherein said instance J is in partitioned normal form (PNF).