protected static function parseRecursive( $type, &$root, &$lines )
	{
		$node = new XML_DOM_Node( strtolower( $type ) );
		$root->addChild( $node );
		while( count( $lines ) )
		{
			$line	= array_shift( $lines );
			$parsed	= self::parseLine( $line );
			if( $parsed['name'] == "END" && $parsed['value'] == $type )
				return $lines;
			else if( $parsed['name'] == "BEGIN" )
				$lines	= self::parseRecursive( $parsed['value'], $node, $lines );
			else
			{
				$child	= new XML_DOM_Node( strtolower( $parsed['name'] ), $parsed['value'] );
				foreach( $parsed['param'] as $param )
				{
					$parts	= explode( "=", $param );
					$child->setAttribute( strtolower( $parts[0] ), $parts[1] );
				}
				$node->addChild( $child );
			}
		}
	}