public static void removeFromParent ( Element elem ) { if ( elem != null && elem . getParentNode ( ) != null ) { elem . getParentNode ( ) . removeChild ( elem ) ; } }
Remove an element from its parent if defined .