Index: DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBB2DCWoRMSTranslator.java	(revision 608)
+++ 	(revision )
@@ -1,505 +1,0 @@
-package test.DEBBTranslator.src;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * 
- */
-
-/**
- * @author gosiaw
- * 
- */
-public class DEBB2DCWoRMSTranslator {
-
-	// TODO:
-	// 1) Configuration file needed
-	// 2) Get rid of all nasty System.out - log4j instead
-	// 3)
-
-	private static final String DEFAULT_DCWORMS_OUTPUT_FILE_NAME = "xml/DCWORMS_TEST.xml";
-	// private static final String DEFAULT_INPUT_FILE_NAME =
-	// "xml/PLMXML_PSNCRECS.xml";
-	private static final String DEFAULT_PLMXML_INPUT_FILE_NAME = "xml/PLMXML_HLRSSmallServerRoom.xml";
-	private static final String DEFAULT_DEBB_COMPONENT_INPUT_FILE_NAME = "xml/DEBBComponents.xml";
-	private static final String DEFAULT_SCHEMA_NAME = "DCWormsResSchema.xsd";
-	private static final String DEFAULT_DEBB_COMPONENT_TRANSFORMATION_FILE_NAME = "xml/DEBBComponentTranslator.xsl";
-	private static DocumentBuilder xmlDocumentBuilder;
-	private static DocumentBuilderFactory domFactory;
-
-	private static HashMap<String, String> computingResourceClasses = null;
-	private static HashMap<String, String> resourceUnitClasses;
-	private static XPath xpath;
-	private static Document dcwormsDocument;
-
-	/**
-	 * 
-	 */
-	public DEBB2DCWoRMSTranslator() {
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		String inputFileName = DEFAULT_PLMXML_INPUT_FILE_NAME;
-		String outputFileName = DEFAULT_DCWORMS_OUTPUT_FILE_NAME;
-
-		if (args != null && args.length > 0) {
-			inputFileName = args[0];
-			if (inputFileName != null && inputFileName.isEmpty() == false) {
-				inputFileName = DEFAULT_PLMXML_INPUT_FILE_NAME;
-			}
-
-			outputFileName = args[1];
-			if (outputFileName != null && outputFileName.isEmpty() == false) {
-				outputFileName = DEFAULT_DCWORMS_OUTPUT_FILE_NAME;
-			}
-		}
-
-		try {
-			initialize();
-
-			// Open and read content of the input file (i.e. PLM XML document)
-			Document plmxmlDocument = readPLMXMLInputFile(inputFileName);
-
-			XPathFactory xpathFactory = XPathFactory.newInstance();
-			xpath = xpathFactory.newXPath();
-			NamespaceContext nsContext = new DEBBNamespaceContext();
-			xpath.setNamespaceContext(nsContext);
-
-			// Find root component (top level DEBB) id
-			XPathExpression expr = xpath
-					.compile("//plm:ProductDef/plm:InstanceGraph/@rootRefs");
-			Object result = expr.evaluate(plmxmlDocument, XPathConstants.NODE);
-			Node rootIdNode = (Node) result;
-			System.out.println(rootIdNode.getNodeName());
-			System.out.println(rootIdNode.getNodeValue());
-
-			// Creating destination, dcworms document
-			dcwormsDocument = xmlDocumentBuilder.newDocument();
-
-			// Creating root, environment, element
-			Element rootElement = dcwormsDocument.createElement("environment");
-
-			// Attr namespaceAttribute = dcwormsDocument
-			// .createAttribute("xsi:noNamespaceSchemaLocation");
-			// namespaceAttribute.setValue(DEFAULT_SCHEMA_NAME);
-			// rootElement.setAttributeNode(namespaceAttribute);
-			dcwormsDocument.appendChild(rootElement);
-			Comment comment = dcwormsDocument
-					.createComment("CoolEmAll testbed description");
-			rootElement.appendChild(comment);
-			// rootElement.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance",
-			// "xmlns:xsi", "value");
-
-			// Creating resources element
-			Element resourcesElement = dcwormsDocument
-					.createElement("resources");
-			rootElement.appendChild(resourcesElement);
-
-			// *****************************************************************
-			// Creating (main) scheduler element
-			// TODO: Fill scheduler with reasonable data!
-			Element schedulerElement = dcwormsDocument
-					.createElement("scheduler");
-			comment = dcwormsDocument.createComment("Default scheduler");
-			schedulerElement.appendChild(comment);
-			resourcesElement.appendChild(schedulerElement);
-
-			// *****************************************************************
-			// Transform top level DEBB and all nested DEBBs
-			transformDEBB(plmxmlDocument, dcwormsDocument, resourcesElement,
-					rootIdNode.getNodeValue());
-
-			// *****************************************************************
-			// TODO: Extract information about sensors from PLM XML
-
-			// write the content into xml file
-			saveDCWoRMSOutputFile(outputFileName, dcwormsDocument);
-
-		} catch (ParserConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (XPathExpressionException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-	}
-
-	private static void initialize() throws ParserConfigurationException {
-		domFactory = DocumentBuilderFactory.newInstance();
-		domFactory.setNamespaceAware(true); // never forget this!
-		domFactory.setValidating(true);
-		domFactory.setAttribute(
-				"http://java.sun.com/xml/jaxp/properties/schemaLanguage",
-				"http://www.w3.org/2001/XMLSchema");
-
-		xmlDocumentBuilder = domFactory.newDocumentBuilder();
-
-		// TODO: Check it this is correct!
-		// TODO: Move it to configuration file
-		computingResourceClasses = new HashMap<String, String>();
-		computingResourceClasses.put("ComputeBox2", "ComputeBox2");
-		computingResourceClasses.put("ComputeBox1", "ComputeBox1");
-		computingResourceClasses.put("NodeGroup", "NodeGroup");
-		computingResourceClasses.put("Node", "Node");
-		computingResourceClasses.put("Processor", "Processor");
-
-		resourceUnitClasses = new HashMap<String, String>();
-		resourceUnitClasses.put("Sensor", "Sensor");
-		resourceUnitClasses.put("Memory", "Memory");
-		resourceUnitClasses.put("Baseboard", "Baseboard");
-		resourceUnitClasses.put("CoolingDevice", "CoolingDevice");
-		resourceUnitClasses.put("Storage", "Storage");
-
-	}
-
-	private static Document readPLMXMLInputFile(String inputFileName) {
-		Document plmxmlDocument;
-		try {
-			plmxmlDocument = xmlDocumentBuilder.parse(inputFileName);
-			return plmxmlDocument;
-		} catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	private static Document readDEBBComponentInputFile(String inputFileName) {
-		Document debbComponentDocument;
-		try {
-			debbComponentDocument = xmlDocumentBuilder.parse(inputFileName);
-			return debbComponentDocument;
-		} catch (SAXException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (IOException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	private static void saveDCWoRMSOutputFile(String outputFileName,
-			Document dcwormsDocument) {
-
-		try {
-			TransformerFactory transformerFactory = TransformerFactory
-					.newInstance();
-			Transformer transformer;
-
-			transformer = transformerFactory.newTransformer();
-
-			DOMSource source = new DOMSource(dcwormsDocument);
-			StreamResult transformResult = new StreamResult(new File(
-					outputFileName));
-
-			// Output to console for testing
-			// StreamResult result = new StreamResult(System.out);
-
-			transformer.transform(source, transformResult);
-
-			System.out.println("File " + outputFileName + " saved!");
-
-		} catch (TransformerConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (TransformerException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-	}
-
-	/**
-	 * Translates specified DEBB and all its nested sub DEBBS
-	 * 
-	 * @param plmxmlDocument
-	 * @param dcwormsDocument
-	 *            TODO
-	 * @param instanceId
-	 * @return
-	 * @throws Exception
-	 */
-	public static void transformDEBB(Document plmxmlDocument,
-			Document dcwormsDocument, Element debbParentElement,
-			String instanceId) throws Exception {
-
-		if (instanceId == null) {
-			throw new Exception("Null DEBB identifier");
-		}
-		if (plmxmlDocument == null) {
-			throw new Exception("Null PLM XML document");
-		}
-
-		if (debbParentElement == null) {
-			throw new Exception("Null parent element in dcworms document");
-		}
-
-		// Find DEBB with given id and transform it
-		// *****************************************************************
-		// 1) ProductInstance -
-		XPathExpression expr = xpath
-				.compile("//plm:ProductDef/plm:InstanceGraph/plm:ProductInstance[@id='"
-						+ instanceId + "']");
-		Object result = expr.evaluate(plmxmlDocument, XPathConstants.NODE);
-		Node productInstanceNode = (Node) result;
-		Node debbNameNode = productInstanceNode.getAttributes().getNamedItem(
-				"name");
-		System.out.println("name=" + debbNameNode.getNodeValue());
-		Node partRefNode = productInstanceNode.getAttributes().getNamedItem(
-				"partRef");
-		System.out.println("partRef=" + partRefNode.getNodeValue());
-		String partId = partRefNode.getNodeValue().substring(1); // Get rid of #
-		// at
-		// the
-		// beginning
-		// UserData - hostname
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='hostname']/@value");
-		result = expr.evaluate(productInstanceNode, XPathConstants.NODE);
-		Node debbHostNameNode = (Node) result;
-
-		// UserData - sequence
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='sequence']/@value");
-		result = expr.evaluate(productInstanceNode, XPathConstants.NODE);
-		Node debbSequenceNode = (Node) result;
-
-		// UserData - label
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='label']/@value");
-		result = expr.evaluate(productInstanceNode, XPathConstants.NODE);
-		Node debbLabelNode = (Node) result;
-
-		// UserData - location
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='location']/@value");
-		result = expr.evaluate(productInstanceNode, XPathConstants.NODE);
-		Node debbLocationNode = (Node) result;
-
-		// *****************************************************************
-		// 2) ProductRevisionView
-		expr = xpath
-				.compile("//plm:ProductDef/plm:InstanceGraph/plm:ProductRevisionView[@id='"
-						+ partId + "']");
-		result = expr.evaluate(plmxmlDocument, XPathConstants.NODE);
-		Node productRevisionViewNode = (Node) result;
-		// debbName = productRevisionView.getAttributes().getNamedItem("name");
-		// System.out.println("name=" + debbName.getNodeValue());
-
-		// UserValue (to extract DEBB name, level or DEBBComponent file)
-		// DEBBComponentId
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value");
-		result = expr.evaluate(productRevisionViewNode, XPathConstants.NODE);
-		Node debbComponentIdNode = (Node) result;
-		if (debbComponentIdNode != null) {
-			System.out.println("debbComponentId="
-					+ debbComponentIdNode.getNodeValue());
-		}
-
-		// DEBBLevel
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='DEBBLevel']/@value");
-		result = expr.evaluate(productRevisionViewNode, XPathConstants.NODE);
-		Node debbLevelNode = (Node) result;
-		if (debbLevelNode != null) {
-			System.out.println("debbLevel=" + debbLevelNode.getNodeValue());
-		}
-
-		// DEBBComponentFile
-		expr = xpath
-				.compile("plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value");
-		result = expr.evaluate(productRevisionViewNode, XPathConstants.NODE);
-		Node debbComponentFileNameNode = (Node) result;
-		String debbComponentFileName = null;
-		if (debbComponentFileNameNode != null) {
-			// Default DEBBComponent file is assumed
-			debbComponentFileName = debbComponentFileNameNode.getNodeValue();
-		} else {
-			debbComponentFileName = DEFAULT_DEBB_COMPONENT_INPUT_FILE_NAME;
-		}
-		System.out.println("debbComponentFileToOpen=" + debbComponentFileName);
-
-		// *****************************************************************
-		// Add computingResource element for the DEBB
-		if (debbLevelNode != null) {
-			Element computingResourceElement = dcwormsDocument
-					.createElement("computingResource");
-			Attr nameAttribute = dcwormsDocument.createAttribute("name");
-			nameAttribute.setValue(debbNameNode.getNodeValue());
-			computingResourceElement.setAttributeNode(nameAttribute);
-
-			Attr classAttribute = dcwormsDocument.createAttribute("class");
-			String dcwormsClass = computingResourceClasses.get(debbLevelNode
-					.getNodeValue());
-			classAttribute.setValue(dcwormsClass);
-			computingResourceElement.setAttributeNode(classAttribute);
-
-			Document debbComponentDocument = readDEBBComponentInputFile(debbComponentFileName);
-			System.out.println("debbComponentNode="
-					+ debbComponentIdNode.getNodeValue());
-			expr = xpath.compile("//*[ComponentId='"
-					+ debbComponentIdNode.getNodeValue() + "']");
-			result = expr.evaluate(debbComponentDocument, XPathConstants.NODE);
-			Node debbComponentNode = (Node) result;
-			if (debbComponentNode != null) {
-				System.out.println("debbComponentNode="
-						+ debbComponentNode.getNodeName());
-			}
-			
-			// DOMSource/DOMResult
-			try {
-//				DOMSource domSource = new DOMSource(debbParentElement);
-				DOMSource domSource = new DOMSource(debbComponentNode);
-				Source xsltSource = new StreamSource(
-						DEFAULT_DEBB_COMPONENT_TRANSFORMATION_FILE_NAME);
-				DOMResult domResult = new DOMResult(computingResourceElement);
-//				StreamResult systemOutResult = new StreamResult(System.out);
-				// create an instance of TransformerFactory
-				TransformerFactory transFact = TransformerFactory.newInstance();
-
-				javax.xml.transform.Transformer trans = transFact
-						.newTransformer(xsltSource);
-
-				trans.transform(domSource, domResult);
-				System.out.println("result node=" + domResult.getNode().getNodeName());
-			} catch (NullPointerException npEx) {
-				System.out.println("NullPointerException on debb "
-						+ debbComponentIdNode.getNodeValue());
-			}
-			
-			if (debbHostNameNode != null) {
-				Element parameterElement = dcwormsDocument
-						.createElement("parameter");
-				Attr parameterNameAttribute = dcwormsDocument
-						.createAttribute("name");
-				parameterNameAttribute.setValue("hostname");
-				parameterElement.setAttributeNode(parameterNameAttribute);
-				Element valueElement = dcwormsDocument.createElement("value");
-				valueElement.appendChild(dcwormsDocument
-						.createTextNode(debbHostNameNode.getNodeValue()));
-				parameterElement.appendChild(valueElement);
-				computingResourceElement.appendChild(parameterElement);
-			}
-
-			if (debbSequenceNode != null) {
-				// TODO: Sequence is described unclearly in the deliverable, not
-				// used in any example. Not sure what to do with it.
-				Element parameterElement = dcwormsDocument
-						.createElement("parameter");
-				Attr parameterNameAttribute = dcwormsDocument
-						.createAttribute("name");
-				parameterNameAttribute.setValue("sequence");
-				parameterElement.setAttributeNode(parameterNameAttribute);
-				Element valueElement = dcwormsDocument.createElement("value");
-				valueElement.appendChild(dcwormsDocument
-						.createTextNode(debbSequenceNode.getNodeValue()));
-				parameterElement.appendChild(valueElement);
-				computingResourceElement.appendChild(parameterElement);
-			}
-			debbParentElement.appendChild(computingResourceElement);
-
-			if (debbLabelNode != null) {
-				Element parameterElement = dcwormsDocument
-						.createElement("parameter");
-				Attr parameterNameAttribute = dcwormsDocument
-						.createAttribute("name");
-				parameterNameAttribute.setValue("label");
-				parameterElement.setAttributeNode(parameterNameAttribute);
-				Element valueElement = dcwormsDocument.createElement("value");
-				valueElement.appendChild(dcwormsDocument
-						.createTextNode(debbLabelNode.getNodeValue()));
-				parameterElement.appendChild(valueElement);
-				computingResourceElement.appendChild(parameterElement);
-
-			}
-
-			if (debbLocationNode != null) {
-				Element parameterElement = dcwormsDocument
-						.createElement("parameter");
-				Attr parameterNameAttribute = dcwormsDocument
-						.createAttribute("name");
-				parameterNameAttribute.setValue("location");
-				parameterElement.setAttributeNode(parameterNameAttribute);
-				Element valueElement = dcwormsDocument.createElement("value");
-				valueElement.appendChild(dcwormsDocument
-						.createTextNode(debbLocationNode.getNodeValue()));
-				parameterElement.appendChild(valueElement);
-				computingResourceElement.appendChild(parameterElement);
-			}
-
-			// *****************************************************************
-
-
-			// Find component
-
-			// *****************************************************************
-			// Get nested instances - nested DEBBs and ask them to transform
-			// themselves
-			Node instanceRefsNode = productRevisionViewNode.getAttributes()
-					.getNamedItem("instanceRefs");
-			// Check if anything is nested at all
-			if (instanceRefsNode != null) {
-				String instances = instanceRefsNode.getNodeValue();
-				System.out.println("instances=" + instances);
-				// Separate instance ids
-				StringTokenizer tokenizer = new StringTokenizer(instances, " ");
-				while (tokenizer.hasMoreTokens()) {
-					String instance = tokenizer.nextToken();
-					System.out.println(instance);
-					// Go down in the hierarchy
-					transformDEBB(plmxmlDocument, dcwormsDocument,
-							computingResourceElement, instance);
-					System.out.println();
-				}
-			}
-		}
-	}
-}
Index: DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBBComponentTranslator.java
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/src/DEBBComponentTranslator.java	(revision 608)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package test.DEBBTranslator.src;
-
-import java.io.FileOutputStream;
-
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-
-/**
- * 
- */
-
-/**
- * @author gosiaw
- * 
- */
-public class DEBBComponentTranslator {
-
-	private static final String DEFAULT_OUTPUT_FILE_NAME = "xml/DEBBComponents_TEST.xml";
-	private static final String DEFAULT_INPUT_FILE_NAME = "xml/DEBBComponents.xml";
-//	private static final String DEFAULT_DEBB_TRANSFORMATION_FILE_NAME = "xml/DEBBTranslator.xsl";
-	private static final String DEFAULT_DEBB_TRANSFORMATION_FILE_NAME = "xml/DEBBComponentTranslator.xsl";
-
-	/**
-	 * 
-	 */
-	public DEBBComponentTranslator() {
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		String inputFileName = DEFAULT_INPUT_FILE_NAME;
-		String outputFileName = DEFAULT_OUTPUT_FILE_NAME;
-		String debbTransformationFileName = DEFAULT_DEBB_TRANSFORMATION_FILE_NAME;
-		
-		if (args != null && args.length > 0) {
-			inputFileName = args[0];
-			if (inputFileName != null && inputFileName.isEmpty() == false) {
-				inputFileName = DEFAULT_INPUT_FILE_NAME;
-			}
-
-			outputFileName = args[1];
-			if (outputFileName != null && outputFileName.isEmpty() == false) {
-				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.");
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-}
Index: DCWoRMS/trunk/src/test/DEBBTranslator/src/Test.java
===================================================================
--- DCWoRMS/trunk/src/test/DEBBTranslator/src/Test.java	(revision 611)
+++ 	(revision )
@@ -1,91 +1,0 @@
-import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * 
- */
-
-/**
- * @author gosiaw
- * 
- */
-public class Test {
-
-	/**
-	 * 
-	 */
-	public Test() {
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
-	 * @param args
-	 * @throws ParserConfigurationException
-	 * @throws IOException
-	 * @throws SAXException
-	 * @throws TransformerException 
-	 */
-	public static void main(String[] args) throws SAXException, IOException,
-			ParserConfigurationException, TransformerException {
-		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-//		factory.setValidating(true);
-
-		Document fullSourceDocument = factory.newDocumentBuilder().parse(
-				new File("xml/DEBBComponents.xml"));
-
-		String fragment = "<ComponentId>hlrs_smallServerRoom</ComponentId>";
-
-		factory = DocumentBuilderFactory.newInstance();
-		Document fragmentSourceDocument = factory.newDocumentBuilder().parse(
-				new InputSource(new StringReader(fragment)));
-
-		Element rootElement = fragmentSourceDocument.getDocumentElement();
-		System.out.println("rootElement=" + rootElement.getNodeName());
-		Node parentNode = rootElement.getParentNode();
-//		Node node = fullSourceDocument.importNode(rootElement, true);
-//		Node parentNode = node.getParentNode();
-		System.out.println("parentNode=" + parentNode.getNodeName());
-		
-		DocumentFragment docfrag = fullSourceDocument.createDocumentFragment();
-
-//		while (parentNode.hasChildNodes()) {
-//			docfrag.appendChild(parentNode.removeChild(parentNode.getFirstChild()));
-//		}
-//		docfrag.appendChild(parentNode);
-
-		Element element = fullSourceDocument.getDocumentElement();
-		element.appendChild(docfrag);
-
-		TransformerFactory transformerFactory = TransformerFactory
-				.newInstance();
-		Transformer transformer = transformerFactory.newTransformer();
-
-		DOMSource source = new DOMSource(fragmentSourceDocument);
-		StreamResult transformResult = new StreamResult(
-				new File("xml/Test.xml"));
-
-		// Output to console for testing
-		// StreamResult result = new StreamResult(System.out);
-
-		transformer.transform(source, transformResult);
-
-		System.out.println("File " + "xml/Test.xml" + " saved!");
-
-	}
-}
