这个简单的样式表应该可以做到:
样式表
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--
Identity transform:
http://en.wikipedia.org/wiki/Identity_transform#Using_XSLT
-->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="orderline">
<item>
<!--
Apply preceding <orderid> sibling and the children of the current element
-->
<xsl:apply-templates select="preceding-sibling::orderid | node()"/>
</item>
</xsl:template>
<xsl:template match="order">
<!--
Only apply <orderline> children, <orderdate> is dropped and <orderid> is
handled by the template above
-->
<xsl:apply-templates select="orderline"/>
</xsl:template>
</xsl:stylesheet>
输入
<xml>
<order>
<orderid>123</orderid>
<orderdate>2013-04-12T00:00:00.000+01:00</orderdate>
<orderline>
<articlename>AAAA</articlename>
<quantity>10</quantity>
</orderline>
<orderline>
<articlename>BBBB</articlename>
<quantity>15</quantity>
</orderline>
</order>
<!-- Added additional <order> element for demonstration -->
<order>
<orderid>456</orderid>
<orderdate>2014-05-13T00:00:00.000+02:00</orderdate>
<orderline>
<articlename>CCCC</articlename>
<quantity>20</quantity>
</orderline>
<orderline>
<articlename>DDDD</articlename>
<quantity>25</quantity>
</orderline>
</order>
</xml>
输出
<?xml version="1.0" encoding="utf-8"?>
<xml>
<item>
<orderid>123</orderid>
<articlename>AAAA</articlename>
<quantity>10</quantity>
</item>
<item>
<orderid>123</orderid>
<articlename>BBBB</articlename>
<quantity>15</quantity>
</item>
<item>
<orderid>456</orderid>
<articlename>CCCC</articlename>
<quantity>20</quantity>
</item>
<item>
<orderid>456</orderid>
<articlename>DDDD</articlename>
<quantity>25</quantity>
</item>
</xml>