/**
     * Convert an XML to Array
     * 
     * @access public static
     * @param string $node_name - name of the root node to be converted
     * @param array $arr - aray to be converterd
     * @return DOMDocument
     * @since 1.1
     */
    public static function &createArray($input_xml)
    {
        $xml = self::getXMLRoot();
		if(is_string($input_xml))
		{
			$parsed = $xml->loadXML($input_xml);
			if(!$parsed) 
			{
				throw new Exception('[XML2Array] Error parsing the XML string.');
			}
		} 
		else 
		{
			if(get_class($input_xml) != 'DOMDocument') 
			{
				throw new Exception('[XML2Array] The input XML object should be of type: DOMDocument.');
			}
			$xml = self::$xml = $input_xml;
		}
		$array[$xml->documentElement->tagName] = self::convert($xml->documentElement);
        self::$xml = null;    // clear the xml node in the class for 2nd time use.
        return $array;
    }