Code example for QName

Methods: getLocalPart, getPrefix

0
     *         the QName has no prefix, the local name is returned. 
     * 
     */ 
    public static String toString(QName qname)
    { 
        String prefix = qname.getPrefix();
        String name = qname.getLocalPart();
         
        if (prefix == null || prefix.length() == 0)
            return name;
         
        return prefix + ':' + name;
    } 
}