Weighted Logics for Nested Words and Algebraic Formal Power Series (Logical Methods in Computer Science, 2010)