They're for allowing multiple markup languages to be combined, without having to worry about conflicts of element and attribute names.
For example, look at any bit of XSLT code, and then think what would happen if you didn't use namespaces and were trying to write an XSLT where the output has to contain "template", "for-each", etc, elements. Syntax errors, is what.
I'll leave the advice and pitfalls to others with more experience than I.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…