code: public static String getAttributeValue(
          Node node, String attributeName, String defaultValue)
      {
          NamedNodeMap attributes = node.getAttributes();
          Node attributeNode = attributes.getNamedItem(attributeName);
          if (attributeNode == null)
          {
              return defaultValue;
          }
          String value = attributeNode.getNodeValue();
          if (value == null)
          {
              return defaultValue;
          }
          return value;
      }
docs: Returns the attribute with the given name from the given node.
  If the respective attribute could not be obtained, the given
  default value will be returned
  
  @param node The node to obtain the attribute from
  @param attributeName The name of the attribute
  @param defaultValue The default value to return when the specified
  attribute could not be obtained
  @return The value of the attribute, or the default value