<?xml version="1.0" encoding="utf-16" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:p="http://www.plmx.org/2007/10/PLMX"

exclude-result-prefixes="p">
  <xsl:output method="xml" encoding="utf-8" version="1.0"  indent="yes" />
  <xsl:template match="/">
    <root>
      <xsl:apply-templates select="p:plmx/p:part/p:structureMarkupItems/p:structureMarkupItem"/>
    </root>
  </xsl:template>
  <xsl:template match="p:structureMarkupItem">
    <Sheet1>
      <Item>
        <xsl:value-of select ="p:findNumber"/>
      </Item>
      <xsl:apply-templates  select="p:part|p:document"/>
      <Quantity>
        <xsl:value-of select ="p:quantity/p:value"/>
      </Quantity>
      <Reference>
        <xsl:for-each select="p:referenceDesignators/p:referenceDesignator">
          <xsl:value-of select="."/>
          <xsl:if test="position()!=last()">,</xsl:if>
        </xsl:for-each>
      </Reference>
    </Sheet1>
  </xsl:template>
  <xsl:template match ="p:part|p:document">
    <Number>
      <xsl:value-of select="p:identifier"/>
    </Number>
  </xsl:template>
</xsl:stylesheet>