I have TEI (text encoding initiative) document containing

```
<div>
  <p>
     some text, and maybe nodes <note>A note</note><lb />
     and some more text<lb />
     final line without lb
  </p>
</div>

```

and I want to transform it to:

```
<div>
  <lg>
     <l>some text, and maybe nodes <note>A note</note></l>
     <l>and some more text</l>
     <l>final line without lb</l>
  </lg>
</div>

```

Transforming the p to lg is trivial by using

```
<xsl:template match="tei:div/tei:p">
   <lg>
     <xsl:apply-templates/>
   </lg>
</xsl:template>

```

But the rest can't i figure out how to do. Turning a sequence of nodes into children of a new parent.

If there is a solution for xslt 1.0 would it be great.