A country borrowing from the rest of the world Well I'm having a some difficulty in understanding completely what the following sentence means and I would like to be sure. 

«(...) a country running a trade deficit is buying more from the rest of the world than it is selling to the rest of the world. In order to pay for the difference between what it buys and what it sells, the country must borrow from the rest of the world. It borrows by making it attractive for foreign financial investors to increase their holdings of domestic assets- in effect, to lend to the country.»

How does this borrowing(in italic) work? I'm not understanding the italic part. Does the country A sells bonds in domestic currency, receives foreign currency, when the foreign investor buys the domestic currency of A to buy the domestic bond of A?

Also why should the current account plus the capital account be equal to zero (up to a statistical discrepancy)?
The idea is that the world economy is closed and value only comes from production. It is maybe best to forget about money for a moment here. Since money derives its value directly from production, anything we say about production applies to money as well.
Since the world economy is closed, a country that is producing less than it consumes must &quot;borrow goods&quot; from other countries to consume (otherwise it cannot consume more than it produces by definition). We can't have the whole world consuming more than it produces, so someone else must be consuming less, i.e. &quot;lends&quot;. This is the case of a trade deficit, i.e. positive net imports. If a country &quot;borrow goods&quot; it effectively also borrows money.
A currency's value (purchasing power) is proportionate to the number of goods in that economy, since all money must be able to buy all goods by definition and legally. (If only 1 loaf of bread and only 1 dollar exist, the dollar has a purchasing power of 1. If (only) 2 dollars exist then each dollar has a purchasing power of 0.5).
How this may work is that the exporting country lends money to the importing country in order to be able to buy more than it sells. In a barter economy this happens directly without money, the extra goods given are loans (as goods in equal value have not been receieved). Since money is not &quot;real&quot; in an economic sense, the same must happen with money. This happens, since each currency's value is related to production and the importing country is producing less (as it doesn't have enough to spare), while the exporting country is producing more (it has more than enough), therefore the respective currency values reflect this.
Very often an importing company will take out a credit from the exporting company and this reflects itself at the country level. Even if money isn't actually lent, it happens through adjustment in exchange rates and interest rates.
Since money's value depends on production value, this is also the  reason the current acount + the capital account must be equal to 0. For any goods bought or sold, money must be paid. Its like saying the value of goods you receive at the store must equal the value of money you give to the cashier. If you get more goods than you have money for you'll simply owe the cashier. Internationally (but alson domestically) you only have money in value of what you produce. Therefore if you produce less than you consume, you don't have enough money (production=money) to pay the cashier for the goods you consume.
Further, the current account is constructed similarly as an account from accounting. It sums up to 0 by (that) construction. Goods leave, money enters, they must have the same value. For more on this you can also consult any introductory accounting book.