Index: DCWoRMS/trunk/src/test/DEBBTranslator/xml/DCWoRMSELementsSorter.xsl
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/xml/DCWoRMSELementsSorter.xsl	(revision 647)
+++ DCWoRMS/trunk/src/test/DEBBTranslator/xml/DCWoRMSELementsSorter.xsl	(revision 647)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+	<!-- Specification of the output document -->
+	<xsl:output method="xml" version="1.0" encoding="UTF-8"
+		indent="yes" />
+
+	<xsl:template match="/">
+		<xsl:apply-templates select="environment"/>
+	</xsl:template>
+
+	<xsl:template match="environment">
+		<xsl:copy >
+			<xsl:copy-of select="@*" />
+			<xsl:apply-templates select="resources"/>	
+		</xsl:copy>
+	</xsl:template>
+	
+	<xsl:template match="resources">
+		<xsl:copy copy-namespaces="no">
+			<xsl:copy-of select="scheduler"/>
+			<xsl:apply-templates select="//resources/computingResource" />
+		</xsl:copy>
+	</xsl:template>
+	
+	<xsl:template match="computingResource">
+		<xsl:copy copy-namespaces="no">
+			<xsl:copy-of select="@*" />
+			<!-- Find nested elements in appropriate order and copy them -->
+			<!-- resourceUnit -->
+			<xsl:apply-templates select="resourceUnit" />
+			<!-- parameter -->
+			<xsl:apply-templates select="parameter" />
+			<!-- profile -->
+			<xsl:apply-templates select="profile" />
+			<!-- location -->
+			<xsl:apply-templates select="location" />
+			<!-- computingResource -->
+			<xsl:apply-templates select="computingResource" />
+		</xsl:copy>
+	</xsl:template>
+
+	<xsl:template match="resourceUnit">
+		<xsl:copy-of select="." copy-namespaces="no" />
+	</xsl:template>
+	<xsl:template match="parameter">
+		<xsl:copy-of select="." copy-namespaces="no" />
+	</xsl:template>
+	<xsl:template match="profile">
+		<xsl:copy-of select="." copy-namespaces="no" />
+	</xsl:template>
+	<xsl:template match="location">
+		<xsl:copy-of select="." copy-namespaces="no" />
+	</xsl:template>
+
+</xsl:stylesheet>
Index: DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DCWoRMSElementsSorter.java
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DCWoRMSElementsSorter.java	(revision 647)
+++ DCWoRMS/trunk/src/test/DEBBTranslator/src/test/DEBBTranslator/src/DCWoRMSElementsSorter.java	(revision 647)
@@ -0,0 +1,68 @@
+/**
+ * 
+ */
+package test.DEBBTranslator.src;
+
+import java.io.FileOutputStream;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+
+/**
+ * @author gosiaw
+ *
+ */
+public class DCWoRMSElementsSorter {
+
+	private static final String DEFAULT_OUTPUT_FILE_NAME = "xml/PLMXML_TEST_SORTED.xml";
+	private static final String DEFAULT_INPUT_FILE_NAME = "xml/PLMXML_TEST.xml";
+	private static final String DEFAULT_PLMXML_TRANSFORMATION_FILE_NAME = "xml/DCWoRMSElementsSorter.xsl";
+	
+
+	/**
+	 * 
+	 */
+	public DCWoRMSElementsSorter() {
+	}
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		String inputFileName = DEFAULT_INPUT_FILE_NAME;
+		String outputFileName = DEFAULT_OUTPUT_FILE_NAME;
+		String debbTransformationFileName = DEFAULT_PLMXML_TRANSFORMATION_FILE_NAME;
+		
+		if (args != null && args.length > 0) {
+			inputFileName = args[0];
+			if (inputFileName == null
+					|| (inputFileName != null && inputFileName.isEmpty() == true)) {
+				inputFileName = DEFAULT_INPUT_FILE_NAME;
+			}
+
+			if (args.length > 1) {
+				outputFileName = args[1];
+				if (outputFileName == null
+						|| (outputFileName != null && outputFileName.isEmpty() == true)) {
+					outputFileName = DEFAULT_OUTPUT_FILE_NAME;
+				}
+			}
+		}
+				
+		try {
+			TransformerFactory tFactory = TransformerFactory.newInstance();
+						
+			Transformer transformer = tFactory
+					.newTransformer(new javax.xml.transform.stream.StreamSource(
+							debbTransformationFileName));
+
+			transformer.transform(new javax.xml.transform.stream.StreamSource(
+					inputFileName),
+					new javax.xml.transform.stream.StreamResult(
+							new FileOutputStream(outputFileName)));
+			System.out.println("File " + inputFileName + " transformed into " + outputFileName + " file");
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+}
