The "base" tag in HTML is self-closing (like, e.g., "br" and "img").You're parsing an XML document, so an XML parser will work much betterfor you.
-- Lino Mastrodomenico