public function getElement( $id )
	{
		$result = array();

		if ( isset( $this->elements[ $id ] ) )
		{
			foreach ( $this->elements[ $id ] as $key => &$element )
			{
				if ( isset( $element['parent'] ) ) continue;
				$element['parent'] = 'xbrl';
			}
			unset( $element );

			$result = $this->elements[ $id ];
		}

		if ( ! isset( $this->tupleRefs[ $id ] ) )
		{
			return $result;
		}
		// The rest of this needs sorting
		$tuple = $this->tupleRefs[ $id ];
		$tupleId = key( $tuple );

		if ( ! isset( $this->elements[ $tupleId ] ) )
		{
			return $result;
		}

		// $fact = array();

		foreach ( $tuple[ $tupleId ] as $index )
		{
			foreach ( $this->elements[ $tupleId ][ $index ]['tuple_elements'][ $id ] as $key => $entry )
			{
				if ( ! isset( $entry['tupleid'] ) )
				{
					$entry['tupleid'] = $tupleId;
				}
				$result[ $entry['guid'] ] = $entry;
			}
		}

		return $result;
	}