1. A grammar for mapping a first grouping of XML data having at least one parent element and a set of corresponding child elements into a second grouping of XML data comprising: a first rule for computing a first child element attribute by extracting data from one or more sources via a query which takes a first parent element attribute as a constant; and a second rule for computing a second parent element attribute by grouping one or more second child element attributes.