]<xsl:for-each select="../DeliveryLine[@LineNumber]">
Here the context node is a DeliveryLine
<DeliveryLine LineNumber="{position()}">
<xsl:for-each select="./*">
./* can be rewritten *, and selects the children of the context node. In your example the only child is a LineReference.
<xsl:if test="name()='LineReference'">[/code]
If you're processing different child elements using different logic, then you ought to be using template rules, which are custom-designed for this purpose. Replace <xsl:for-each select="*"/> by <xsl:apply-templates/> and write a template rule for each possible kind of child element.
In the template rule for LineReference, you can get the values of the two attributes using the expressions
<xsl:value-of select="@ReferenceType"/>
<xsl:value-of select="@AssignedBy"/>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference