I would use an XQuery flwor expression in your scenario. Here is an example to remodel the xml that you have provided and add the extra nodes to the xml schema:
DECLARE @XML XML
SET @XML = '
<doc>
<heading>
<orderid>1</orderid>
</heading>
<line>
<lineid>1</lineid>
</line>
<line>
<lineid>2</lineid>
</line>
</doc>'
SELECT @XML.query('for $x in /doc
return
<doc>
<heading>
{$x/heading/*}
<headinginfo>default</headinginfo>
</heading>
{
for $y in /doc/line
return
<line>
{$y/*}
<lineinfo>default</lineinfo>
</line>
}
</doc>
')